私は持っている...
/config/routes.rb :
resources :documents do
member do
get :print
end
end
/config/authorization_rules.rb :
role :admin do
has_permission_on [:documents], :to => [:print]
end
app/controllers/documents_controller.rb :
def print
render :layout => "print"
end
app/views/layouts/print.html.haml :
!!!
%html
%body
= yield
複数のコントローラで定義された印刷アクションからこの印刷レイアウト ファイルにアクセスしたいと考えています。
admin としてログインして にアクセスするとhttp://localhost:3000/documents/1/print
、このエラーが発生するのはなぜですか?
Missing template documents/print, application/print with {:locale=>[:en], :formats=>[:html], :handlers=>[:erb, :builder, :coffee, :haml]}. Searched in:
* "/Users/steven/Dropbox/testivate/app/views"
* "/Users/steven/.rvm/gems/ruby-1.9.2-p320/gems/declarative_authorization-0.5.6/app/views"
print.html.haml
ファイルを移動する/app/views/application/
か/app/views/documents/
、エラーを変更しますが、それを取り除くことはできません。