How to handle different scenarios across different actions in a Rails controller dried with inherited_resources -


Say I have the following controllers and want to ban: Edit, update, and: Delete the current user's own foyer.

P> Class FooController & lt; InheritedResources :: Base before_filter: login_required response_to: html def Show @foo = Foo.find params [: ID] Show! Finally saved def collection @ Ioos || = Fu. F.E.F.Ef.A_Off_Avations_ChenOpen_Under End End

My simple and probably naive question is whether the above situation can be re-applied to look better? It feels like I am overriding a lot of heritage resources.

If you want the facility of the building, foo through the current user Only one before_filter (see below) will use. However, I will apply an authorization library as soon as possible to delete and delete the actions.

  Class FooController & lt; InheritedResources :: Base before_filter: login_required before_filter: assign_user ,: only = & gt; [: Create] Feedback: html Personal DRAF Assignor Build_Source By User = Current_Under End End  

:


Comments

Popular posts from this blog

MySql variables and php -

url rewriting - How to implement the returnurl like SO in PHP? -

Which Python client library should I use for CouchdB? -