Sha256: 5075e63f081f2ec5e8cc69e7a673dbc1ca92e47bef1220b65aad74687dd3196b

Contents?: true

Size: 378 Bytes

Versions: 7

Compression:

Stored size: 378 Bytes

Contents

class PostsController < ApplicationController

  respond_to :json, :xml, :html, :rabl_test_v1

  def index
    @posts = Post.order('id ASC').load
  end

  def show
    @post = Post.find(params[:id])
  end

  def renderer
    post = Post.find(params[:id])
    render json: Rabl.render(post, 'posts/renderer', view_path: 'app/views', format: :json, scope: view_context)
  end
end

Version data entries

7 entries across 5 versions & 1 rubygems

Version Path
rabl-0.14.3 fixtures/ashared/controllers_rails_5/posts_controller.rb
rabl-0.14.3 fixtures/rails6/app/controllers/posts_controller.rb
rabl-0.14.2 fixtures/ashared/controllers_rails_5/posts_controller.rb
rabl-0.14.2 fixtures/rails6/app/controllers/posts_controller.rb
rabl-0.14.1 fixtures/ashared/controllers_rails_5/posts_controller.rb
rabl-0.14.0 fixtures/ashared/controllers_rails_5/posts_controller.rb
rabl-0.13.1 fixtures/rails5/app/controllers/posts_controller.rb