Module: ActionView::Helpers::UrlHelper

Defined in:
lib/activesalesforce.rb

Overview

Provides a set of methods for making easy links and getting urls that depend on the controller and action. This means that you can use the same format for links in the views that you do in the controller. The different methods are even named synchronously, so link_to uses that same url as is generated by url_for, which again is the same url used for redirection in redirect_to.

Instance Method Summary collapse

Instance Method Details



27
28
29
30
31
32
33
# File 'lib/activesalesforce.rb', line 27

def link_to_asf(active_record, column)
  if column.reference_to
    link_to(column.reference_to, { :action => 'show', :controller => column.reference_to.pluralize, :id => active_record.send(column.name) } )
  else
    active_record.send(column.name)
  end
end