Class: Throwup::WireframesController

Inherits:
ActionController::Base
  • Object
show all
Defined in:
app/controllers/throwup/wireframes_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



4
5
6
7
8
9
10
11
12
# File 'app/controllers/throwup/wireframes_controller.rb', line 4

def index
  root = Rails.root.join("app", "views", "wireframes")
  @files = Dir[root.join "**", "*"]
  @files = @files.map do |f|
    f.to_s.slice! root.to_s
    f.match(%r{/([^\.]+)})[1]
  end
  p @files
end

#showObject



14
15
16
# File 'app/controllers/throwup/wireframes_controller.rb', line 14

def show
  render template: "wireframes/#{params[:id]}"
end