Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8491549
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T22:27:30+00:00 2026-06-10T22:27:30+00:00

I am using refinerycms and override the functionality of reset password. Here are my

  • 0

I am using refinerycms and override the functionality of reset password.
Here are my password view page:

password/new.html.erb

<h2>Forgot your password?</h2>
<%= form_for(resource, :as => resource_name, :url => refinery.user_password_path, :html => { :method => :post }) do |f| %>

<div><%= f.label :email %><br />
<%= f.email_field :email %></div>

<div><%= f.submit "Send me reset password instructions" %></div>
<% end %>

password/edit.html.erb

<h2>Change your password</h2>   

<%= form_for(resource, :as => resource_name, :url => refinery.user_password_path, :html => { :method => :put }) do |f| %>
<%= f.hidden_field :reset_password_token %>

<div><%= f.label :password, "New password" %><br />
<%= f.password_field :password %></div>

<div><%= f.label :password_confirmation, "Confirm new password" %><br />
<%= f.password_field :password_confirmation %></div>

<div><%= f.submit "Change my password" %></div>
<% end %>

and the password controller is:

 class PasswordsController < Devise::PasswordsController
   helper Refinery::Core::Engine.helpers
   before_filter :store_password_reset_return_to, :only => [:update]

   def store_password_reset_return_to
     session[:'refinery_user_return_to'] = refinery.admin_root_path
   end
   protected :store_password_reset_return_to

   # Rather than overriding devise, it seems better to just apply the notice here.
   after_filter :give_notice, :only => [:update]
   def give_notice
     Rails.logger.debug @refinery_user
     if %w(notice error alert).exclude?(flash.keys.map(&:to_s)) or             @refinery_user.errors.any?
    flash[:notice] = t('successful', :scope => 'users.reset', :email => @refinery_user.email)
     end
  end
   protected :give_notice

   # GET /registrations/password/edit?reset_password_token=abcdef
   def edit
    if params[:reset_password_token] and (  @refinery_user = Refinery::User.where(:reset_password_token => params[:reset_password_token]).first).present?
      #Rails.logger.debug @refinery_user
      #logger.debug"******************************************************"
      respond_with(@refinery_user)
    else
      redirect_to refinery.new_user_password_path,
                :flash => ({ :error => t('code_invalid', :scope => 'refinery.users.reset') })
    end
  end

    # POST /registrations/password
    def create
    if params[:user].present? and (email = params[:user][:email]).present? and (user = Refinery::User.where(:email => email).first).present?

      # Call devise reset function.
      user.send(:generate_reset_password_token!)
      UserMailer.reset_notification(user, request).deliver
      redirect_to refinery.new_user_session_path,:notice => t('email_reset_sent', :scope => 'users.forgot')
    else
        flash.now[:error] = if (email = params[:user][:email]).blank?
        t('blank_email', :scope => 'users.forgot')
      else
        t('email_not_associated_with_account_html', :email => ERB::Util.html_escape(email), :scope => 'users.forgot').html_safe
      end
      render :new
    end
  end
end

Mail is sucessfully going to email with reset notification and with edit password link but
When i enter new password and hit enter it will gives error
“undefined method email' for nil:NilClass",app/controllers/passwords_controller.rb:15:ingive_notice’.
How can i remove that error ??please help!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T22:27:31+00:00Added an answer on June 10, 2026 at 10:27 pm

    The result is to simply remove give_notice method and use error message field in password/edit.html.erb as:

    <% if resource.try(:errors) %>
      <%= devise_error_messages! %>
    <% end %>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using refinery cms and want to override (add a method) to their page
Using Rails 3.2.0.rc2 and ruby 1.9.3p0 In app/views/requests/_form.html.erb I have the following code for
Using preview 4 of ASP.NET MVC Code like: <%= Html.CheckBox( myCheckBox, Click Here, True,
Using php/html, I want to retrieve email addresses (plus other information) from MySQL and
I've developed a website using RefineryCMS, and now the client have asked for a
Using WebViewBrush I can render web page content (it's screen shot) to e.g. Rectangle
Using C#, I need a class called User that has a username, password, active
Using RefineryCMS, does anyone know if there's a way to fallback to the default
I'm contemplating using RefineryCMS for a large web application which will include newsletters, blogs,
Using HTML 5, I want to play multiple sounds simultaneously. how can I do

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.