Skip to content

Commit

Permalink
Support both symbols and strings as action parameters to contextual_l…
Browse files Browse the repository at this point in the history
…ink_to helper.
  • Loading branch information
huerlisi committed Oct 29, 2010
1 parent 72e209a commit 6cd12d3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ def contextual_link(action, url, options = {})
def contextual_link_to(action, resource_or_model)
output = ActiveSupport::SafeBuffer.new

# Handle both symbols and strings
action = action.to_s

case action
when 'new'
model = resource_or_model
Expand Down

0 comments on commit 6cd12d3

Please sign in to comment.