RailsCasts Pro episodes are now free!

Learn more or hide this

rackom's Profile

GitHub User: rackom

Comments by

Avatar

Yeah, thanks a lot but:
I can fix it, so RABL would be in handler list, BUT in rails 3.2.2 it seems to me that it is trying to render json while requesting for html. #180

Avatar

RABL crashes for me on rails 3.2.1 on ruby 1.9.2

/Users/rackom/.rvm/gems/ruby-1.9.2-p290/gems/rabl-0.2.8/lib/rabl/template.rb:66:in <top (required)>: uninitialized constant ActionView::TemplateHandlers (NameError)

jbuilder on same configuration throws this error
Illegal instruction: 4

Any help?

Avatar

Great screencast! Is it possible to add count of subelements to json/xml output? e.g. photo has many comments, and I want to add comments_count to /photos.json ?

Avatar

Ok so I have found that out:

application_controller.rb
class ApplicationController < ActionController::Base

  def authenticate!
    case request.format
    when Mime::XML, Mime::JSON
      # use http_basic_authentication
    else
      # use form_based_authentication
    end
  end

  #...
end
some_controller.rb
class SomeController < ApplicationController
  before_filter :authenticate!

  #...
end
Avatar

What if I`m using :uuid as POST parameter? Is it going to work?

Avatar

How can i restrict use of SecureAuthentication to html requests only? I want use HTTP basic authentication for json requests. Thanks