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> controller 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 Normally this should work, but you might want to change it a little end and then in the 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
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
Add to user_attributes key
: skip_user_confirmation , which will be either
true or false
Comments
Post a Comment