I would add a field to users table called completed_profile
of boolean type:
rails g add_completed_profile_to_users completed_profile:boolean
then create a filter method in application_controller.rb
def complete_profile
if current_user.completed_profile?
redirect_to the_path_after_log_in
else
redirect_to edit_profile_path, error: "Please update your profile."
end
end
*field_one and field_two are the required fields to fill in before proceeding to app.*
In other controller of your app:
before_filter :complete_profile
this filter should not be applied to controller and action that responds for rendering the edit profile page or new account page, if edit_profile_path = users#edit
means in users controller your filter will look like:
before_filter :complete_profile, except: ['edit', 'update', 'new', 'create']
variant 2, without migration:
create a filter method in application_controller.rb
def complete_profile
if current_user.field_one.present? && current_user.field_two.present?
redirect_to the_path_after_log_in
else
redirect_to edit_profile_path, error: "Please update your field_one and field_two."
end
end
in other controller of your app:
before_filter :complete_profile