I'm trying to have whole controller containing simple_form/form_for managing another model.
this is what i have now:
Model -> user.rb
Controller -> system/employees_controller.rb
User model is created by Devise gem and I would like to handle it with my own controller. I can handle users from console. Updating them, creating new users, changing their passwords ok, that's why I though i would have spare controller for handling this and I would like to keep simple_form so I can keep design same.
class System::EmployeesController < ApplicationController # …. # GET /system/employees/new def new @system_employee = User.new end # …. end
<%= simple_form_for @system_employee do |f| %> <%= f.error_notification %> <div class="form-inputs"> <%= f.input :email %> # … <div class="form-actions"> <%= f.button :submit %> </div> <% end %>
and error I'm getting:
Showing .../app/views/system/employees/_form.html.erb where line #1 raised:
undefined method `users_path' for #<#<Class:0x007fb49cef2678>:0x007fb49a616ba0>
Extracted source (around line #1):