Rails 4.1, reaching the driver knowing edit and use _form.html.erb again. I tried to do the following:
<% = Form_for @user, :controller => "admin/users" do | f |%>
<button type='submit'>Guardar</button>
<% end %>
#Controller ===============
def new
@user = User.new
end
def create
@user = User.new(user_params)
respond_to do |format|
if @user.save
format.html { redirect_to admin_users_url, notice: "User #@user.name} was successfully created." }
format.json { render :controller => 'admin/users', action: 'show', status: :created, location: @user }
else
format.html { render :controller => 'admin/users', action: 'new' }
format.json { render json: @user.errors, status: :unprocessable_entity }
end
end
end
But it does not work I can not get to the route that is my controller ("admin / users"), if anyone can help me