Rails for API only applications (>3.2)
1
vote
1answer
21 views
How do I get exceptions to render a plain text version of the Rails development error page?
I am using rails-api to build an API with no web interface. When I get errors in development, I'd love to see just the error message and stacktrace in plain text without all of the HTML wrapping. How ...
0
votes
0answers
17 views
Versioning and ActiveModel::Serializer [closed]
I would like to know what are actually the best practices concerning ActiveModel Serializers' versioning. I have just found a gem that offers a way to do that, however its development doesn't seem to ...
0
votes
1answer
32 views
What is the better way to make API with Rails?
What is the better way to create API with Rails:
Create mountable rails engine in main application. In routes set url path for api: example.com/api/v1.
Create separately app with rails-api gem and ...
0
votes
0answers
112 views
Rails with devise registration controller override issues
I am building a rails api service with rails-api gem and decided to use Devise gem (Warden) for user accounts, but i am getting some strange errors...
Here is my Registrations controller in ...
0
votes
2answers
34 views
Building a Rails Api service issues
I am building a rails api service and i started with rails-api gem and devise gem for user authentication, i also rolled out my own versioning, the excellent RailsCast on Versioning APIs was all i ...
1
vote
3answers
60 views
What is best way to write api in rails with authentication?
I want write api for my rails application and with authentication. I want to pass my associations data also but in selective and conditional manner.
If I use respond_to block for that then there will ...
0
votes
0answers
23 views
Rails 4 - how do I use data and data structure of third party application for serving rails API?
I have written a Rails API which is basically dealing with users,entities and relationship and using that information defining some processes. This application will be consumed by some organizations ...
1
vote
1answer
44 views
authenticate_or_request_with_http_token returning html instead of json
I've created a rails-api application and proceeded to secure it using token authentication.
I've set a before_filter that is calling a method which uses authenticate_or_request_with_http_token. ...
0
votes
0answers
24 views
capybara not executing my javascripts
I'm having issues with capybara executing my javascripts.
I'm using:
capybara 2.1.0
minitest 4.7.4
capybara-email 2.1.3
rails-api 0.1.0
Here is my test:
Firstly, I tried selenium web driver but ...
0
votes
1answer
28 views
Part-Rails-API / part-Rails app
I need to creat a Rails API for a mobile app. The API will send and receive json formatted requests.
I would also like to create a back-end to manage the app. The back-end would use Rails with a user ...
1
vote
2answers
193 views
Devise + Rails-API
So, I'm starting an API from a new rails-api project.
I would like to use Devise for all the authentication stuff. I already learned a lot from my recent googling-sessions. I have a working ...
1
vote
1answer
28 views
How to show login page based on API response
I am consuming a Rails API using a client app written in Rails. If the user is not authenticated then i have to show the login page. I have created a structure of making API calls from only one Ruby ...
1
vote
2answers
72 views
Why is rails-api returning a 500 internal server error instead of 404?
Using rails-api :
def show
render json: Room.find(params[:id])
end
This works when the resource is found. But looking for one that doesn't exist returns a 500 error. Shouldn't this return ...
0
votes
0answers
60 views
Rails API for desktop app. and mobiles (performance)
I'm actually trying to migrate a huge classic Rails application to an architecture which will be similar to that :
an API (using Rails API + ActiveModel::Serializers) with all my models, contexts, ...
1
vote
2answers
562 views
Rails api gem and devise token authentication
If someone could shed some light It would be greatly appreciated as I'm bit clueless on this issue. Basically I'm trying to get the devise authentication done with a JSON only rails rest api app built ...
0
votes
0answers
26 views
Correct way of updating resource in REST API
I am using the rails-api gem, and here is a doubt I have. When hitting the URL to update a User, I pass the User attributes in JSON format, and here is how I have coded the update method:
def update
...
1
vote
1answer
191 views
Ember Route model issue
I am following a tutorial by Brian Cadarella on DockYard.
Building an Ember app with Rails-api backend.
http://reefpoints.dockyard.com/ember/2013/01/09/building-an-ember-app-with-rails-api-part-2.html
...
0
votes
0answers
158 views
Ember.js/Rails-api simple app not working
I am following the tutorial by Brian Cardarella on Dockyard.
Which is setting up a small app with Ember.js and Rails-api backend.
...
0
votes
3answers
99 views
Making JS request to my Rails API
I am new to rails.
I am creating a basic rails-api. Trying to add user to my model using JS request ...
Here is my HTML file: (add-user.html)
<script type="text/javascript" charset="utf-8">
...
0
votes
1answer
77 views
Curl command to save Rails send_data output
I'm a new bee to the rails api and curl commands.
I have a rails api which responds to request send from native app. And to one of the request sent from native api using curl command my rails api is ...
0
votes
1answer
121 views
How to add another method in rails controller
I am having a problem while adding a new method to a controller, here are the details:
matches_controller.rb
def index
@matches = Match.all
render rabl: @matches
end
def current
@matches ...
0
votes
1answer
67 views
minitest racktest
Does anybody have any examples of using minitest and reacktest together to create request specs?
I want to be able to request a resource:
get '/api/resource', format: :json
And then test the ...
1
vote
0answers
103 views
Styling for multi tenant rails api apps
I have a rails-api app where I'd like to serve a stylus stylesheet with some variables set based on the current tenant.
The main app itself is a static, standalone RIA built in Dojo and doesn't make ...
0
votes
1answer
69 views
RABL Sorting results
Just started using RABL Gem w/ Rails 3.2.6 and getting my head around it. I am new to some parts of this stack as well so thank you for bearing with me.
I have a classroom model that has_many ...
0
votes
0answers
103 views
Sessions or HTTP token authentication in rails-api apps?
I'm trying to figure out the best way to do authentication for a rails-api app, although I'm seeing that sessions might just be a nicer and more supported approach.
Is there any conventional wisdom ...
0
votes
1answer
306 views
Rails-api HTTP token authentication
I'm looking to set up a rails-api app and would like to be able to be able to access the user throughout requests.
I've read that HTTP token authentication is pretty much the way to go here, passing ...
0
votes
0answers
33 views
Using Dojo 1.8 in a rails-api project
I'm looking to write a dojo RIA and have the data done by rails. I'm starting out with dojo-boilerplate and rails-api.
I'm a little bit unsure at the moment as to how I should be hosting the source ...
2
votes
1answer
277 views
How to use view helpers with rails-api gem?
I use rails-api and rabl gems to make api application. I don't want to put a lot of logic into rabl views but if that I want to extract it into helpers. Rails-api gem doesn't include helpers support ...
1
vote
3answers
678 views
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 to use a redirect since also the URL should change according to the response.
One option ...
0
votes
2answers
240 views
Hide password_digest error message in JSON output
I'm building a simple JSON API using the rails-api gem.
models/user.rb:
class User < ActiveRecord::Base
has_secure_password
attr_accessible :email, :password, :password_confirmation
...
0
votes
0answers
52 views
rails-api: get serialized output of data without rendering
I have model that includes a serializer that is defined via the Rails API gem. It works when I do a respond_with(response) but not when I do render :json => response. The output is different and it ...
1
vote
2answers
78 views
Rails API with a single access key
After searching S/O, I haven't found anything that directly answers my question, so I'll ask:
I want to have a front-end web application (just Javascript) powered by a separate back-end Rails server. ...
3
votes
1answer
208 views
Is it okay to comment out the `wrap_parameters` initializer?
I was getting this error on starting my Rails-API app with Foreman and Thin.
AM@~/Documents/RailsWS/app1229 >foreman start
09:47:39 web.1 | started with pid 773
09:47:44 web.1 | => Booting ...
1
vote
1answer
394 views
Setting Content-Type header for RSpec and Rails-API
I'm using the rails-api gem to build a web service and want to test my API with RSpec. Every request I make, regardless of the HTTP method has the CONTENT_TYPE header set as ...
2
votes
1answer
271 views
RSpec and Mongoid together with rails-api
I'm trying to use RSpec together with Mongoid and rails-api. The Gems I'm using are rspec-rails and mongoid-rspec. Everything is fine except of this little thing:
# users_controller_spec.rb
describe ...
4
votes
3answers
926 views
Getting rails-api and strong_parameters to work together
When including
gem 'strong_parameters'
gem 'rails-api'
together in my Gemfile, calling params.require like
private
def user_params
params.require(:user).permit(:first_name, :last_name)
end
...
4
votes
4answers
649 views
emberjs handle 401 not authorized
I am building an ember.js application and am hung up on authentication. The json rest backend is rails. Every request is authenticated using a session cookie (warden).
When a user first navigates ...
1
vote
0answers
131 views
how to use rails-api gem with CouchRest model
I'm trying to set up a rails API using the rails-api gem rails-api and couchrest model. Using rails-api strips out a lot of the middleware and modules and I believe that is why I'm getting the ...
2
votes
1answer
124 views
How to perform load test on rails based RESTful API?
this might be wrong to ask here but Can anyone suggest me a tool to test a rails based RESTful API? I need to perform load or stress test on this API and also i should be able to write script i need. ...
2
votes
1answer
81 views
Is there any way to use MiniProfiler within a Rails-API?
I'm trying to find a way to use MiniProfiler for Ruby in a Rails-API app ?
Thanks,
Santiago
4
votes
1answer
701 views
Rails (3.2.7): override image_tag for asset_host
development.rb:
config.action_controller.asset_host = "assets.myserver.com"
view script:
<%= image_tag('header.jpg') %>
yields:
<img alt="Header" src="/header.jpg" />
should be:
...
1
vote
1answer
126 views
Receive video files through http on my rails JSON api
So here's the thing. I believe my case is pretty particular at this point, and some help from the experts it's highly advisable.
I have an API built on Rails (3.2.6) and what I want to able to do is ...
6
votes
2answers
3k views
rails-api authentication by header's token
I'd like to work with rails-api gem special to create API-only application. To provide authentication mechanism I want to use built-in authenticate_or_request_with_http_token method described in ...