Allow admin to add users
Tried this: How To: Manage users through a CRUD interface
But still getting password blank error on save.
REQUEST: Devise add a config option that allows a normal route and controller for the User model.
Until then, this hack works by going all around Rails and around Devise.
routes post 'savenew', to: 'users#savenew'
controller:
def savenew
rawsql = "insert into users (name,email, created_at,updated_at) values ('#
{user_params[:name]}', '#{user_params[:email]}',now(), now())"
sql = rawsql
ActiveRecord::Base.connection.execute(sql)
redirect_to action: 'index'
end
new.html.erb
<%= form_for modelname, :url => {:action => "savenew"} do |f| %>
See on the wiki:
https://github.com/plataformatec/devise/wiki/How-to-manage-users-with-a-standard-Rails-controller-using-a-somewhat-CRUDE-HACK-that-WORKS!
Please use the mailing list or StackOverflow for questions/help, where a wider community will be able to help you. We reserve the issues tracker for issues only.
Seems like this is an issue.
Can you please provide a sample application that reproduces the error?