Ruby on Rails Tuesday, November 1, 2011

thanks for response, the solution I provided also works if you want to
pass params in hash via query string when there isn't a direct
association between multiple models

On Oct 31, 3:26 pm, Tim Shaffer <timshaf...@me.com> wrote:
> On Sunday, October 30, 2011 9:31:50 PM UTC-4, John Merlino wrote:
>
> >    get "send_activation_notification"
> > => :send_activation_notification, :as => "send_activation" do
> >    resources :users do
> >                resources :accounts
> >              end
> >  end
>
> > But it doesn't work for me. Note that send_activation_notification is
> > not a restful route, so I couldnt model my code exactly as shown in
> > the rails book.
>
> That's not a valid route at all. I think you might have it backwards. Check
> out the results of "rake routes" if you need to see what all your routes
> look like.
>
> Instead of this:
>
> get "send_activation_notification" => :send_activation_notification, :as =>
> "send_activation" do
>   resources :users do
>     resources :accounts
>    end
>  end
>
> You might want to do something like this:
>
> resources :users do
>   get 'send_activation_notification', :on => :member
>   resources :accounts
> end
>
> Then you will have a send_activation_notification_user route that you can
> use.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment