On 1 February 2014 05:47, Bizt <[email protected]> wrote:
> Actually I've changed the whole thing to:
>
> def index
>
>   @account = current_user.accounts.find_by_id(params[:account])
>   @transactions = @account.transactions;
> end
>

@account = Account.find(params[:account])
should also work.  A possible disadvantage of this method (depending
on your application) is that a manually constructed url could show an
account that does not belong to the current_user.

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].
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/CAL%3D0gLuprKkU2yzDFbqO-At___HnddoNhqKWPHG6EFjWo3KUmQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to