11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'app/controllers/static_stuff/pages_controller.rb', line 11
def show
template = File.join(
File.basename(params[:controller]),
params[:page]
)
html = render_to_string template, layout: false
render text: html, layout: layout
rescue ActionView::MissingTemplate => error
if error.message =~ %r{Missing template #{template}}
message = "Static page not found. No route matches [GET] /#{template}"
raise ActionController::RoutingError, message
else
raise error
end
end
|