RailsCasts Pro episodes are now free!

Learn more or hide this

Dimitri Akimaru's Profile

GitHub User: gothic1234

Comments by Dimitri Akimaru

Avatar

In rails 4 it seems that attr_accessible is removed from the model, and is not used any more. In general, I have difficulties getting this to work, and would have wanted to see an updated version with rails 4!

Avatar

Yep, had the same error. Thanks for helping me figure this out.

Avatar

HOw would you send the message after that? I can generate the form, but I'd like to see the continuation, where he commented out in the controller.
Thought to use NotificationsMailer.new_message(@message).deliver but this gives me error:
undefined methodattribute' for Message:Class`
This may be due to the fact we dont use activeRecord.

Avatar

I overcame a problem with the above, which occurred when I submitted the email to which the password_reset email should be sent. It would say:
ActiveRecord::RecordInvalid in PasswordResetsController#create
Validation failed: Password is too short (minimum is 6 characters), Password confirmation can't be blank
I have no idea why it would say that, but the above fixed it. What exactly does
save!(:validate => false) do?