Skip to content
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

* http://github.com/niquola/simple_rest

ActionControllers helper methods for restful response handling

  • Just DRY respond_to do |format|; …; end;

  • Support for jsonp and pdf

  • Support json request work around though magic parameter _json, if generic json request is imposibble (for example when using jsonp)

in config/environment.rb

config.gem 'simple_rest'

then

sudo rake gems:install

To handle uncatched exceptions restfully add this to ApplicationController

class ApplicationController < ApplicationController::Base
   rescue_exceptions_restfully
end

Example:

def action 
  #fetch result
  options = {:status=>:ok,:serialize_opts=>some options will be passed to to_json or to_xml}
  simple_rest result,options
end
  • 0.0.2 add json request magic parameter support

For more info see tests and source code :)

About

ActionControllers helper methods for restful response handling

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages