Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ///Booking Controller///
- @user = User.generate_random_password
- @user.save
- ///User.rb///
- def self.generate_random_password
- generated_password = Devise.friendly_token.first(8)
- user = User.create!(:email => "james@james.com", :firstname => "jamo", :gender => "male", :password => generated_password)
- end
- This creates the a new user in the DB with the fields mentioned above, when you submit the booking form.
- What I cant get working is passing the information from the booking form below into the model.
- ///booking form///
- <%= fields_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
- <%= f.text_field :firstname, autofocus: true, :placeholder => "First Name" %>
- <%= f.email_field :email, autofocus: true, :placeholder => "Email Address" %>
- <%= f.hidden_field :gender, :value => "male" %>
- <% end %>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement