次の CMS ページで使用するパーシャルを作成しました。
/app/views/users/_register_home_page.html.haml
私の CMS ページは次のようになります。
{{ cms:partial:/users/register_home_page }}
これをブラウザー (つまり、Chrome) から呼び出すと、正常に動作します。また、シークレットモードに移動するとき(Cookieが送信されないようにするため)
私のテストページをcurlから呼び出す:
curl "http://localhost:5000/test"
戻り値
ActionView::MissingTemplate at /
================================
> Missing partial users/_register_home_page with {:locale=>[:en], :formats=>[:all], :variants=>[], :handlers=>[:erb, :builder, :raw, :ruby, :coffee, :haml]}. Searched in:
* "/Users/doug/dev/my-rails-app/app/views"
actionview (4.1.7) lib/action_view/path_set.rb, line 46
-------------------------------------------------------
41 end
42 METHOD
43 end
44
45 def find(*args)
> 46 find_all(*args).first || raise(MissingTemplate.new(self, *args))
47 end
48
49 def find_all(path, prefixes = [], *args)
50 prefixes = [prefixes] if String === prefixes
51 prefixes.each do |prefix|
curl が同じ結果を返すことを期待しています。
更新:Accept: text/html
curl ステートメントから を省略すると、エラーが発生します。