Skip to content

Unable to see any @options #446

@agrobbin

Description

@agrobbin

Your README notes that any options passed in the controller will be accessible in the serializer:

Also note that any options passed to render :json will be passed to your serializer and available as @options inside.

Unfortunately I cannot get that to hold true. When doing either of these two:

respond_with user, includes: [:special_key]

or

render json: user, includes: [:special_key]

The resulting value of @options is nil, both on master and in v0.8.1. When prying into the classes themselves when they are being used, it looks like the options should be passed starting here, but instead the only options that are passed at the point are:

{
 :prefixes=>["api/users", "api"],
 :template=>"show",
 :layout=>
  #<Proc:0x007f8435ace598@/usr/local/var/rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/actionpack-3.2.15/lib/abstract_controller/layouts.rb:383>}

Any thoughts would be appreciated!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions