Hi, was tryin to do a restful method to allow users to change
password.
This is what i did:
1) use restful authentication plugin.
2) use the code here
http://www.railslodge.com/plugins/75-restful-authentication/documentations/1-change-password
3) realise that
no1. i am using something funny like /v1/users/:permalink/
change_password and not just /change_password
no2. i cant use html.erb for some reasons hence i resorted to
using .rhtml
4) end up re writing the view code as such:
<table>
<% form_for (:url =>
change_password_update_user_path(current_user.permalink), :html =>
{ :method => :put }) do |f| %>
<tr>
<td>Old Password
<%= password_field_tag ''old_password'',
@old_password, :size => 45, :class => ''text''
%></td>
</tr>
<tr>
<td>New Password
<%= password_field_tag ''password'', {}, :size
=> 45, :class
=> ''text'' %>
Between 4 and 40 characters</td>
</tr>
<tr>
<td>Confirm new password
<%= password_field_tag ''password_confirmation'',
{}, :size
=> 45, :class => ''text'' %></td>
</tr>
</table>
<%= submit_tag ''Change password'' %>
<%end%>
5)
wrote my routes.rb
base = ''/v1''
map.resources :users, :path_prefix => base, :member =>
{:change_password => :get, :change_password_update => :put} do |users|
users.resources :orders, :path_prefix =>
''/v1/users/:permalink''
end
6) got this error when i tried to attempt to change my password and
press the submit button
no route found to match "/v1/users/testuser1/change_password" with
{:method=>:post}
why is it that after submitting the form, i will trigger a POST to
change_password_user_path?
please advise
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---