Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby Build a Simple Ruby on Rails Application Creating an Authentication System Generating the Devise Views

Kris Chery
Kris Chery
935 Points

I am working on this tutorial. I am currently running on rails 4.2.4. attribute_accessible doesnt seem to be working

I am reading the document on the latest devise,but can't seem to get it to work. I am running on version 4.2.4 which means that they have moved the acceptance of data to the controller. I have been following this documentation though but i don't quite know how to attack this issue.

https://github.com/plataformatec/devise

Could you explain how you would attack this issue if i want to permit the field output to be saved in the database.

Should i create a def user_params to the user controller.

Please help,

Please post your code

Kris Chery
Kris Chery
935 Points

what file should i be putting? The views work fine? Would you like to see the Devise User Model file and the application controller? Routing files ? Please let me know. I only have one user model made with devise and the other model my post were scaffolded .

I have the same issue.. I am getting the error SyntaxError in Devise::RegistrationsController#new when trying to load the sign_up view. Please help, it obviously has something to do with the newer version of Devise.

Kris Chery
Kris Chery
935 Points

I figured it out. Go in the application controller and paste this code. Thats where the user params needs to be put.

Make sure you reference if its params for login or sign_up

  protect_from_forgery with: :exception

  before_action :configure_permitted_params, if: :devise_controller? 


  protected

    def configure_permitted_params
      devise_parameter_sanitizer.for(:sign_up) {|u| u.permit(:first_name, :last_name,
                                                :profile_name, :email, :password, :password_confirmation)}
    end