Hello,

I am trying to move some logic from my views into a helper.  If album
with id 123 is found the view displays "found". If I replace 123 with
something that does not exists the page is just blank... Why don't I
get the "not found" message?

Any ideas?

#album view
<%= link_to_album rescue nil %>

#album helper
  def link_to_album
    if Album.find(123)
      link_to "found", @album
    else
      link_to "not found", @album
    end
  end

Best regards.
Asbjørn Morell.
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to