> While I can applaud the desire, I think in this case you should NOT
> attempt to simplify that in any way, as it would obfuscate what's going
> on. This is clean, terse, and extremely clear what is going on.
>
> If this sort of thing is repeated over and over with different status
> codes, *that*
I use this type of code for different message and status in my api.
def 404
respond_to do |format|
format.json {render json: { error: '404, not found' }, status: 404}
format.xml {render xml: { error: '404, not found' }, status: 404}
end
end
This works but can I refactoring this code,
Colin Law wrote in post #1181373:
> On 12 February 2016 at 23:37, Roy Royal wrote:
>> The requirements for my api is.
>> * at least json but preferably also xml
>> * sort resources on dates
>> * search for a resource in a http request
>> * get resources belong
Hi!
I'm building my first API with rails and i hope someone can point me in
the right direction.
What I want to know is which tutorials I should watch/read and also
which gems/framework I should use. All tips will be helpful
The API should follow RESTful and HATEOAS (don't have to be strictly)
Th
4 matches
Mail list logo