When I render a partial which does not exists, I get an Exception. I'd like to check if a partial exists before rendering it and in case it doesn't exist, I'll render something else. I did the following code in my .erb file, but I think there should be a better way to do this: <% begin %> <%= render :partial => "#{dynamic_partial}" %> <% rescue ActionView::MissingTemplate %> Can't show this data!
Ruby/Railsと直接関係ありませんが、かつてRubyコミュニティで愛された_why氏の名言を紹介したいと思います。 when you don’t create things, you become defined by your tastes rather than ability. your tastes only narrow & exclude people. so create. – Why the lucky stiff (何も作っていないとき、人は自分の能力よりも好みによって特徴付けられることになる。好みは世界は狭め、他人を排除するばかりだ。だから、作れ) これは2005年頃から2009年にかけてRubyコミュニティで「Why the lucky stiff(_why)」のペンネームで活躍していた、ある多才なRubyistのツイートです。 発言の文脈が分からないので、もし
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く