Do you mean that is the value of params? If so then params[:branch]
is a hash rather than a id value. Perhaps you mean
find(params[:branch][:branch_id]), or perhaps I misunderstand what you
are trying to do.
Colin
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/rubyonrails-talk/-/TYBQZXmnIWAJ.
> To post to this group, send email to rubyonra...@googlegroups.com.
> To unsubscribe from this group, send email to
> rubyonrails-ta...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
On 3 April 2012 12:55, amvis <vgrkr...@gmail.com> wrote:
> Just i called one function in my program, but i need to pass one
> json parameter...But getting the error like
> ArgumentError (Unknown key: branch_id):
>
> CODE
>
> branch1(params[:branch])
>
> def branch1(branch)
> branch123 = Branch.find(params[:branch])
> end
>
> And my rest-client body is
>
> {"user":
> {"password":"password","user_name":"user2"},"branch":{"branch_id":"1"}}Do you mean that is the value of params? If so then params[:branch]
is a hash rather than a id value. Perhaps you mean
find(params[:branch][:branch_id]), or perhaps I misunderstand what you
are trying to do.Colin
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/rubyonrails-talk/-/TYBQZXmnIWAJ.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To unsubscribe from this group, send email to
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/U26tcu0h4lMJ.
To post to this group, send email to rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.