Ruby on Rails ActionController Controllers (Basic)


Example

class UsersController < ApplicationController
  def index
    respond_to do |format|
      format.html { render html: "Hello World" }
    end
  end
end

This is a basic controller, with the addition of the following route (in routes.rb):

resources :users, only: [:index]

Will display the Hello World message in a webpage when you access the URL /users