On 12 Apr 2009, at 17:43, Amita Bhatkhande wrote:

>
> Instead of repeating this for show, edit, and delete in every
> controller, I would like to put this into an application_controller.  
> How
> do I pass current controller name to the application controller? The
> controller and model names are matching, so I would generate a class
> name from controller name, then do a begin-find-rescue stuff.
>
> Also, does this belong to controller? My first thought was to handle
> this in model, as it is related to ActiveRecord. Any thoughts on  
> this ?
>
If the user asks to see object blah and that doesn't exist, then what  
to tell the user is definitely controller material.
If I were you I'd take a look at rescue_from.

Fred
> Please help me with putting it into app_con anyway.
>
> ~
> Amita.
> -- 
> Posted via http://www.ruby-forum.com/.
>
> >


--~--~---------~--~----~------------~-------~--~----~
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