开发者

Ruby on Rails ActiveScaffold: Showing {{model}} instead of model name?

I'm using ActiveScaffold with Ruby on Rails and I'm loving it, however there is one weird thing. Whenever I hit "Edit" or "Create New" in my webapp's ActiveScaffold, it says "Create {{model}}" or "Update {{model}}" in the webapp rather than using the model's name. Why is this? I have an ads_controller.rb that includes this:

active_scaffold :ad do |config|
  config.label = "Ads"
  config.columns = [:name, :description, :imageUrl, :linkUr开发者_JS百科l, :apps, :created_at,      :updated_at]
  config.update.columns = [:name, :description, :imageUrl, :linkUrl, :apps]
  config.create.columns = config.update.columns
  list.sorting = {:created_at => 'DESC'}
  columns[:imageUrl].label = "Image URL"
  columns[:linkUrl].label = "Link URL"
end

And my routes.rb includes this:

map.namespace :admin do |admin|
  admin.root :controller => 'admin_home', :action => 'index'
  admin.resources :ads, :active_scaffold => true
end

Any thoughts on why I'm seeing "Create {{model}}" instead of "Create ad" ?


I just had this problem yesterday.

Looks like the correct syntax to perform interpolation on resources is using %{model} instead of {{model}}, despite some documentation claiming otherwise.

Check your resource files in config/locales.


If you have activescaffold installed as a plugin, you'll have to edit: vendor/plugins/active_scaffold/lib/active_scaffold/locale/en.yml and replace the {{model}}, etc with %{model}

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜