Sha256: 2267c3569ae6cb386a138dedf78ce47641836b269ee545028da4a8a2a8f4aa77

Contents?: true

Size: 592 Bytes

Versions: 5

Compression:

Stored size: 592 Bytes

Contents

class PostsController < ApplicationController
  # Use fake post for controller as I don't want active record to mingle here.
  Post = Struct.new(:title)

  def index
    @posts = [
      Post.new('First'),
      Post.new('Second'),
    ]
  end

  def some_data
    data = Rails.root.join('app', 'assets', 'images', 'rails.png').read
    send_data data, filename: 'rails.png', type: 'image/png'
  end

  def some_file
    send_file Rails.root.join('app', 'assets', 'images', 'rails.png')
  end

  def some_redirect
    redirect_to posts_path
  end

  def some_boom
    raise "boom!"
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
nunes-0.4.0 test/rails_app/app/controllers/posts_controller.rb
nunes-0.3.1 test/rails_app/app/controllers/posts_controller.rb
nunes-0.3.0 test/rails_app/app/controllers/posts_controller.rb
nunes-0.2.0 test/rails_app/app/controllers/posts_controller.rb
nunes-0.1.0 test/rails_app/app/controllers/posts_controller.rb