app/helpers/application_helper.rb
# Add a cancel link for shared forms. Looks at the provided object and either
# creates a link to the index or show actions.
Add a cancel link for shared forms. Looks at the provided object and either
creates a link to the index or show actions.
Add a cancel link for shared forms . Looks at the provided object and either creates a link to the index or show actions .
def link_to_cancel( object )
    path = object.class.name.tableize
    path = if object.new_record?
             send( path.pluralize + '_path' )
           else
             send( path.singularize + '_path', object )
           end
    link_to "Cancel", path
  end
def link_to_cancel ( object ) path = object . class . name . tableize path = if object . new_record? send ( path . pluralize + '_path' ) else send ( path . singularize + '_path' , object ) end link_to "Cancel" , path end
Add a cancel link for shared forms.
Add a cancel link for shared forms .
object
<not_specific>