Hi I\'m from Grails background and new to Rails. I wish to do http basic authentication in rails.
I have a code in grails which does basic authentication like this:<
In Ruby on Rails 4 you can easily apply basic HTTP Authentication site wide or per controller depending on the context.
For example, if you need site wide authentication:
class ApplicationController < ActionController::Base
http_basic_authenticate_with name: "admin", password: "hunter2"
end
Or on a per controller basis:
class CarsController < ApplicationController
http_basic_authenticate_with name: "admin", password: "hunter2"
end