one way:

link_to(obj.status_name, #{obj.status}_path)

this would require any extra routes to be added, as well as a
status_name attribute/model to supply the text.


On Aug 5, 2:31 pm, Brad <brad.we...@gmail.com> wrote:
> I want to render a different link_to name and url path based on an
> objects "status" attribute in the index view.  Would love to know how
> to get the logic out of the view, but barring that, when I use if/else
> statements in erb I can only render 4 different link options.
> Likewise, case/when is only allowing me to show 2 different results?
> Not sure what I am doing wrong (except I am sure I am putting way too
> much logic in the view).
>
> Any help or guidelines would be much appreciated.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to