Thanks for that Colin, after revisiting a few chapters there I understand 
it better now. 

But it seems that User controller will be pretty FAT over time.

What are the strategies to DRY it up?

On Sunday, March 2, 2014 5:15:53 AM UTC+8, Colin Law wrote:
>
> On 1 March 2014 19:20, Brandon <[email protected] <javascript:>> wrote: 
> > 1. Users_Controller CRUD expects param[:id] to create User instance. 
> With 
> > Orders_Controller, I'd like to retrieve a list of users who have 
> ordered. I 
> > know Orders_Controller expects param[:id] to be for creating Order 
> instance. 
> > So does this mean if I want to retrieve a list of users who have 
> ordered, I 
> > should create a method called 'get_orders' in Users_Controller? 
> > 
> > 2. Can user's id be passed as the param[:id] for controllers other than 
> > Users_Controller? I find that it seems to make CanCan hard to maintain. 
> > 
> > 3. There seem to be too many methods in Users_Controller (e.g. 
> deactivate, 
> > change_role, etc.). How do you organise them/reduce them? 
>
> It seems there are a lot of basic things that you have not yet got the 
> hang of.  I suggest that you start by working right through a good 
> tutorial such as railstutorial.org (which is free to use online) which 
> will show you the basics of rails, so that you will be able to answer 
> most questions yourself. 
>
> Colin 
>
>
> > 
> > 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups 
> > "Ruby on Rails: Talk" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an 
> > email to [email protected] <javascript:>. 
> > To post to this group, send email to 
> > [email protected]<javascript:>. 
>
> > To view this discussion on the web visit 
> > 
> https://groups.google.com/d/msgid/rubyonrails-talk/18a42aa1-a4fb-425b-a182-1db5faff0a6f%40googlegroups.com.
>  
>
> > For more options, visit https://groups.google.com/groups/opt_out. 
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/3b5396b5-45e0-4f08-a7f4-705e4d31653e%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to