Yeah, I was only allowing POST and GET on that route, Rails was
looking for a PUT because the object user was not new.

Thanks

On Thu, Feb 10, 2011 at 12:28 AM, Jim Ruther Nill <jvn...@gmail.com> wrote:
> since the routes match exactly, I think the problem is in the method.  I
> haven't used simple_form yet so I don't know what it does
> but you should check if it sets the method to PUT for existing records.
>
> On Thu, Feb 10, 2011 at 8:17 AM, jm <joaomiguel.pere...@gmail.com> wrote:
>>
>> Original from here: Rails 3 route problem
>>
>> Hello,
>>
>> After solving the other problem with routes , now I have another one.
>>
>> I have this route in my routes.rb:
>>
>>
>> match "user/create_new_password/:reset_password_key"
>> =>"users#create_new_password", :via=>[:post, :get],
>> :as=>:create_new_password
>> I can test it in my functional tests like this:
>>
>>
>> test "should create new password " do
>>    post :create_new_password,
>> {:user=>{:password=>"123456", :password_confirmation=>"123456"},
>> :reset_password_key=>user.reset_password_key}
>> end
>> In my view, I have the following form:
>>
>>
>> =simple_form_for @user, :url=>create_new_password_path do |f|
>>
>> =f.input :password, :label=>I18n.t("activerecord.attributes.user.email")
>>
>> =f.input :password_confirmation,
>> :label=>I18n.t("activerecord.attributes.user.password_confirmation")
>>    =f.submit I18n.t "activerecord.actions.user.create_new_password"
>>
>> When I submit the form, I get:
>>
>>
>> No route matches "/user/create_new_password/
>> OqQxYTgjYKxXgvbAsTsWtMnIpMOpsjCRzLGZmJZLSbYtjvcvdpO"
>> The big string, is the reset_password_key.
>>
>> I have tested it in functional tests with the same value for
>> reset_password_key.
>>
>> The relevant output for rake routes is:
>>
>>
>> create_new_password POST|GET /user/
>> create_new_password/:reset_password_key(.:format)
>> {:controller=>"users", :action=>"create_new_password"}
>> I'm missing something...
>>
>> --
>> 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+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/rubyonrails-talk?hl=en.
>>
>
>
>
> --
> -------------------------------------------------------------
> visit my blog at http://jimlabs.heroku.com
>
> --
> 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+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>



-- 
João Miguel Pereira
http://jpereira.eu

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to