class DeviseIosRails::Rails::Railtie
Public Instance Methods
api_behavior(*args)
click to toggle source
simply render the resource even on POST instead of redirecting for ajax
# File lib/devise-ios-rails.rb, line 34 def api_behavior(*args) if post? display resource, :status => :created # render resource instead of 204 no content elsif put? || delete? display resource, :status => :ok else head :no_content end end
authenticate_entity!(controller, entity)
click to toggle source
# File lib/devise-ios-rails.rb, line 49 def authenticate_entity!(controller, entity) controller.send("authenticate_#{entity.name_underscore}!".to_sym, force: true) end
json_resource_errors()
click to toggle source
# File lib/devise-ios-rails.rb, line 29 def json_resource_errors resource.errors end