ruby on rails - Prevent Only Devise confirmation email while creating user through nested attributes -


I'm alternatively creating users with Nested attributes I just want to leave the confirmation email but < Previous> class ShipperOrder & lt; ActiveRecord :: Base is_to: User accepts_assist_edit_data: User and class user & lt; ActiveRecord :: Base is_my: shipper_orders and

controller

  class ShipperOrdersController & lt; ApplicationController def @shipper_order = ShipperOrder.new (order_params) if @shipper_order.save flash [: notice] = "create shaft order" and flash Now [: warning] = @ shipper_order.errors.full_messages.join (",") render: error end end personal def order_param params.quare (: shipper_order). Passit ({user_group: [: first_name,: email, last_name, : Mobile_Phone, Password: Terms__f_service, password_setset_record}},: end of end   

I am now making an order and if the user wants to give this order to the user who is in the database not available. Then I am making that user with the help of Nested_Adit. Everything works fine, I want to disable confirmation email for this type of user.

You can add attr_accessor such as

  class user & lt; Some class attr_accessor: skip_user_confirmation_ before_save: skip_confirm private def skip_confirm self.skip_confirmation! If self.skip_user_confirmation end end   

Normally this should work, but you might want to change it a little end

and then in the controller Add to user_attributes key : skip_user_confirmation , which will be either true or false

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -