title: How an action call works in Rails
body: <p><br>
  I have the following action method:</p>
  
  <pre><code>class CommandsController &lt; ApplicationController
  .
  .
  .
    def usersList
      @command = Command.find_by(id: params[:id])
      @users_list = @command.user_commands.paginate(page: params[:page], per_page: 10)
    end
  end
  </code></pre>
  
  <p>The following view: users_list.html.erb</p>
  
  <pre><code>&lt;% provide(:title, "Command list") %&gt;
  &lt;h1&gt;Lista Utenti per &lt;%= @command.content %&gt;&lt;/h1&gt;
  
  &lt;%= will_paginate @users_list %&gt;
  
  &lt;ul class="users"&gt;
     &lt;% @users_list.each do |user| %&gt;
  
     &lt;li&gt;&lt;%= user.name.capitalize %&gt;, &lt;%= user.email %&gt;&lt;/li&gt;
  
  &lt;% end %&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>And in the routes.rb</p>
  
  <pre><code>  get 'commands/:id/usersList' =&gt; 'commands#users_list', as: :list
  </code></pre>
  
  <p>Now I don't understand why going to lochalhost:3000/commands/1/usersList I receive the following error:</p>
  
  <pre><code>undefined method `content' for nil:NilClass
  </code></pre>
  
  <p>refered to line <code>&lt;h1&gt;Lista Utenti per &lt;%= @command.content %&gt;&lt;/h1&gt;</code>
  Why does it do so? When I call an action, before it renders the page and then after it executes the code inside the method?</p>
  
  <p>I resolved the problem by changing the names: <code>usersList --&gt; userslist</code> and then <code>users_list.html.erb ---&gt;userslist.html.erb</code> and in the routes.rb ----> <code>get 'commands/:id/userslist' =&gt; 'commands#userslist', as: :list</code>
  Then I don't understand the naming convention...if I declare an action usersList how should I rename the related view?</p>