Activity
Posted in Devise: Add a select to my signup form
What version of devise are you using to have had to move your permitted params into your ApplicationController?
Using Devise 4.2.0 ($ gem list | grep devise
) I still have my sanitizers in controllers/registrations_controller.rb and no issue...
def configure_permitted_parameters
devise_parameter_sanitizer.permit(:sign_up) do |user|
user.permit(:first_name, :last_name, :email, :password, :password_confirmation, :avatar, :time_zone)
end
devise_parameter_sanitizer.permit(:account_update) do |user|
user.permit(:first_name, :last_name, :avatar, :email, :password, :password_confirmation, :current_password, :time_zone,
contact_attributes: [:line_1, :line_2, :city, :state, :zip, :phone])
end
end
The only thing I don't like is having to declare the sanitizer for the :sign_up action and :account_update separately - it could probably be combined but I haven't dug into it yet (maybe not though??)
I'd suggest making a branch of your project and just test it out. But from the looks of it, it seems like that gem would help you with the organization of your assets but it doesn't seem like there's any real magic going on there that you couldn't just replicate yourself and would save yourself the overhead of the gem dependency.
Read up on how rails handles layouts and the asset pipeline. Also be sure to watch Chris' video on purchased themes.
I believe you could use layouts and get away with something like this...
#application_controller.rb
class ApplicationController < ActionController::Base
layout :user_theme
def user_theme
current_user.theme
end
end
Then each layout you could adjust which css files to use.
Depending on your needs and how you have your site setup, I believe you could also just load a themed css file from the <head>
... with a <%= stylesheet_link_tag current_user.theme %>
This should get your thinker tinkering - I'm sure there's a better way and I'm not sure what effect the multi-tenancy could have on any of these ideas...!
Posted in My Development Environment Discussion
If working on OSX, check out Dash for API referencing and snippets - https://kapeli.com/dash - integrates with most major IDE's - searchable, offline mode, etc...