Ruby on Rails
Friday, January 31, 2014
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[:accoount])
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:
-- @account = Users.accounts.find_by_id(
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 :@account = Users.accounts.find_by_id(
def indexparams[:accoount])
@transactions = @account.transactions.find_all_by_account(params[: accoount]);
endOn Sat, Feb 1, 2014 at 9:29 AM, Bizt <marty...@gmail.com> 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?--To view this discussion on the web visit https://groups.google.com/d/
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 .
To post to this group, send email to rubyonra...@googlegroups.com .msgid/rubyonrails-talk/ .fd67df38-8b15-46ae-9f72- 2c94068c12fb%40googlegroups. com --
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+unsubscribe@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.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment