File: application_controller.rb

package info (click to toggle)
ruby-rabl 0.17.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,280 kB
  • sloc: ruby: 6,732; javascript: 102; makefile: 6
file content (14 lines) | stat: -rw-r--r-- 277 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
class ApplicationController < ActionController::Base
  protect_from_forgery

  before_filter :default_format_json

  protected

  def default_format_json
    if(request.headers["HTTP_ACCEPT"].nil? &&
       params[:format].nil?)
      request.format = "json"
    end
  end
end