I am relatively new to Rails, so I still have a lot of questions. I am creating an administration panel right now.
I have a model AdminUser, a folder admin_users in my views with 2 views only, dashboard and index and an admin_users_controller which is:
class AdminUsersController < ApplicationController
if params[:admin_user][:username].present? && params[:admin_user][:password].present?
found_user = AdminUser.where(:username => params[:admin_user][:username]).first
authorized_user = found_user.authenticate(params[:admin_user][:password])
redirect_to :controller => 'admin_users', :action => 'dashboard'
render :nothing => true, :status => :ok
You are not required to have a view. In fact quite a few good reasons exist to not need a view:
The conventions are there for the most common circumstances, but there are also conventions for lesser common, and still valid situations.
Note that methods that are not intended to be renderable actions should be placed in the
private section of the class to keep them separated from actual actions. Don't expose any methods in the public interface of the controller, except those that are intended to be actions.