Aaargh!!! I see it, I didn't type "account" correctly. I thought I was 
using the method incorrectly. How did I not see that for so long?!

@account = Users.accounts.find_by_id(params[:acco*o*unt])


This now works - @account = current_user.accounts.find_by_id(params[:
*account*])





On Saturday, 1 February 2014 13:29:50 UTC+9, jainvi...@gmail.com wrote:
>
> Please, try Users instead of current_user, like :
> def index 
>   @account = Users.accounts.find_by_id(params[:accoount])
>   @transactions = @account.transactions.find_all_by_account(params[:
> accoount]);
> end
>
>
> On Sat, Feb 1, 2014 at 9:29 AM, Bizt <marty...@gmail.com <javascript:>>wrote:
>
>> Btw, I get the following error:
>>
>> undefined method `transactions' for nil:NilClass
>> To me this tells me that @account if not found, or is returning an empty 
>> array. Am I using the wrong method, or parameters? 
>>
>>  -- 
>> 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 rubyonrails-ta...@googlegroups.com <javascript:>.
>> To post to this group, send email to 
>> rubyonra...@googlegroups.com<javascript:>
>> .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/rubyonrails-talk/fd67df38-8b15-46ae-9f72-2c94068c12fb%40googlegroups.com
>> .
>>
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>
>
> -- 
> Thanks & Regard
>    Vikram Jain
> ============= 
>

-- 
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 rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/5bfa1106-2f3e-4bd1-9e86-5b0bad63920d%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to