Top "Rails-api" questions

Rails for API only applications (>3.2)

Rails API : Best way to implement authentication?

I'm writing a Rails 4 app that will expose an API for a mobile app that's yet to be developed. Users …

ruby-on-rails ruby-on-rails-4 rails-api
Rails: Restrict API requests to JSON format

I would like to restrict requests to all API controllers to being redirected to the JSON path. I would like …

ruby-on-rails json redirect restriction rails-api
Is devise's token_authenticatable secure?

I'm building a simple api with Rails API, and want to make sure I'm on the right track here. I'm …

ruby-on-rails api authentication devise rails-api
Rails: Undefined method `flash' for ActionDispatch::Request

I'm trying to write an Ember application in Rails 4, and have decided to go with rails-api for the api controllers, …

ruby-on-rails ruby-on-rails-4 rails-api
Display or get the HTTP header attributes in Rails 4

I have an application developed in Rails and I am trying to see the attributes in the HTTP header. Is …

ruby-on-rails ruby rails-api
Allow CORS in Ruby on Rails

In my config/application.rb file, I have this code, config.action_dispatch.default_headers = { 'Access-Control-Allow-Origin' => '*', 'Access-Control-Request-Method' =&…

ruby-on-rails ajax cors rails-api
routing error uninitialized constant API rails

I have referred this link to create my own api but facing an routing error since this is the first …

ruby-on-rails ruby-on-rails-4 rails-api
Rails 5. Strong params require not used if one permit key is set

I am using Rails 5 to create a JSON Api. My controller uses strong parameters with one require attribute like this: …

ruby-on-rails ruby strong-parameters rails-api ruby-on-rails-5
devise user sign_in gives authentication error for CSRF token authenticity token

I am using devise (latest version - 3.2.0) with rails (latest version - 4.0.1) I'm doing simple authentication (without ajax or api) …

ruby-on-rails ruby-on-rails-4 devise csrf rails-api
Token based authentication for Rails JSON APIs

I make API in rails. For normal authentication we use devise but in API how to implement devise for authentication. …

ruby-on-rails ruby ruby-on-rails-4 devise rails-api