Hello
I have big Problem with an function. I want to change the Password for a
User in my Program.
View:
<fieldset style="width: 400; margin-left:auto;
margin-right:auto;">
<legend>Neues Passwort</legend>
<%form_tag :url => {:controller => :admin, :action =>
:changepw_admin} do %>
<div class="text">Bitte alle Felder
ausfuellen.</div>
<table border="0" cellpadding="0"
cellspacing="0"
width="100%">
<tr>
<td width="20%"
height="36"><label>altes
Passwort:</label></td>
<td align="left"><%= password_field_tag
:old_password,
params[:old_password], :size => 30 %></td>
</tr>
<tr>
<td width="20%" height="36"><label
for="user_password">neues Passwort:</label></td>
<td align="left"><%= password_field_tag
:new_password,
params[:new_password], :size => 30 %></td>
</tr>
<tr>
<td width="20%" height="36"><label
for="user_password_confirmation">Passwort
bestaetigen:</label></td>
<td align="left"><%= password_field_tag
:new_password_confirmation, params[:new_password_confirmation], :size =>
30 %></td>
</tr>
</table>
<%= submit_tag "Passwort aendern"%>
<% end %>
</fieldset>
Controller:
def changepw_admin
@user = User.fignd_by_id(session[:user_id])
@user.reset_pw(params[:new_password])
@user.save
flash[:notice] ="Password fuer #{@user.username} geƤndert"
redirect_to(:action => "index")
end
Log:
Processing AdminController#change_admin (for 127.0.0.1 at 2007-06-08
15:37:37) [POST]
Session ID: 2941d2fee48c9a3ed0f73614cbbce94c
Parameters: {"commit"=>"Passwort aendern",
"url"=>"controlleradminactionchangepw_admin",
"action"=>"change_admin",
"controller"=>"admin",
"old_password"=>"12345",
"new_password"=>"er90di",
"new_password_confirmation"=>"er90di"}
[4;35;1mUser Columns (0.000000) SHOW FIELDS FROM users
[4;36;1mUser Load (0.000000) [0;1mSELECT * FROM users WHERE
(users.`id` = 1) LIMIT 1
[4;35;1mUser Load (0.000000) SELECT * FROM users WHERE
(users.`id` = 1) LIMIT 1
Rendering within layouts/admin
Rendering admin/change_admin
Completed in 0.07000 (14 reqs/sec) | Rendering: 0.01000 (14%) | DB:
0.00000 (0%) | 200 OK
[http://localhost/admin/change_admin?url=controlleradminactionchangepw_admin]
The Problem is that he never go into the function changepw_admin.
Please can somebody help me to find the error?
Thanks
--
Posted via http://www.ruby-forum.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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
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
-~----------~----~----~----~------~----~------~--~---