Reputation: 2670
EDIT: All I need is render /devise/registrations/edit in /settings/password
To do that put this your view e.g. /settings/password
<%= render :template => 'devise/registrations/edit' %>
and This in SettingsHelper
def resource_name
:user
end
def resource
@resource = current_user || User.new
end
def devise_mapping
@devise_mapping ||= Devise.mappings[:user]
end
def devise_error_messages!
return "" if resource.errors.empty?
messages = resource.errors.full_messages.map { |msg| content_tag(:li, msg) }.join
sentence = I18n.t("errors.messages.not_saved",
:count => resource.errors.count,
:resource => resource_name)
html = <<-HTML
<div id='error'>
<h2>{sentence}<h2>
<p>#{messages}</p>
</div>
HTML
html.html_safe
end
Upvotes: 0
Views: 2773
Reputation: 19203
You can do the following:
#routes.rb
get 'settings/password' => 'users#password'
And then in your controller, create the action password:
#users_controller.rb
def password
redirect_to :edit
end
If you are using Rails 3, you can simply do this:
#routes.rb
get 'settings/password' => redirect('users/edit')
Maybe this is what you are after?
#routes.rb
devise_for :users do
get 'settings/password' => 'devise/registrations#edit'
end
Upvotes: 2