Displaying 5 results from an estimated 5 matches for "set_flash_messag".
Did you mean:
set_flash_message
2011 Feb 14
0
Devise is causing the [The change you wanted was rejected.] Error...
...) which just
passed in with Devise password.
Below is the custom devise controller that I am using.
The custom controller looks like this
def create
resource = warden.authenticate!(:scope => resource_name, :recall
=> "oldusercheck") #calling oldusercheck helper function
set_flash_message(:notice, :signed_in)
sign_in_and_redirect(resource_name, resource)
end
def oldusercheck
@user = User.find_by_email(params[:user][:email])
if @user.nil?
set_flash_message(:alert, :invalid)
redirect_to :action=>''new''
else
if @user.valid_pas...
2010 Dec 17
1
flash[;notice] not display after redirection
...group but
couldn''t find any answer, so iy may not be related to Devise , so
I debugged it ..
.
class Users::RegistrationsController <
Devise::RegistrationsController
..
# POST /resource/sign_up
def create
build_resource
if resource.save
if resource.active?
set_flash_message :notice, :signed_up
sign_in_and_redirect(resource_name, resource)
else
set_flash_message :notice, :inactive_signed_up, :reason =>
resource.inactive_message.to_s
debugger
expire_session_data_after_sign_in!
redirect_to after_inactive_sign_up_path_for(...
2013 Jun 16
0
Monkey patching a gem's controller method
I want to change the keys Devise is using in flash alerts. (Devise uses
:notice and :alert flash keys, but I want to change them to :success and
:error so that I can display nice green/red boxes with Bootstrap.)
To that end, I want to monkey patch the `set_flash_message` method in
DeviseController<https://github.com/plataformatec/devise/blob/270e2ece19f20fdbb349b8130c31acc5b222fabb/app/controllers/devise_controller.rb>
.
I created a file called *config/initializers/overrides.rb* that contains
the following:
class DeviseController
> def set_flas...
2013 Jul 04
3
Rspec devise, testing extended RegistrationController action destroy
...g with rails 3.0.20 and ruby 1.8.7 .
I have extended the destroy action from the RegistrationController, to soft
delete users instead of really deleting them from the database.
def destroy
# raise resouce.inspect # this is just to see if the test hits the
action
resource.soft_delete
set_flash_message :notice, :destroyed
sign_out resource
redirect_to new_session_path(resource)
end
This is working on the browser.
When I try to write a test to the delete action, I get the test as passed
but does not execute the code. Prove of that is I have put a raise on the
action and it did not...
2012 Feb 01
6
Does Devise make use of a "status" method? Weird bug.
...lace!
The problem is coming from the SessionsController#create method, but
this is just the stock version I''ve done nothing do it:
# POST /resource/sign_in
def create
resource = warden.authenticate!(:scope => resource_name, :recall =>
"#{controller_path}#new")
set_flash_message(:notice, :signed_in) if is_navigational_format?
sign_in(resource_name, resource)
respond_with resource, :location => after_sign_in_path_for(resource)
end
This is Devise 2.0.0 on a Rails 3.1 app, Ruby 1.9.2p136. I''m just
realizing, as I go googling around, just how new this...