Active_scaffold routing error
If you didn't see my question yesterday, this is my second rails app. The first one went nice and smooth, but this one keeps giving me one random error after another. I have set active_scaffold for this app as well as the latest app (first error, instead of using script / install plugin git: // active_scaffold repository, I did script / install plugin http: // active_scaffold.) I didn't want to describe basic CRUD on low-end models. After installation problems (before I found a http solution from a Windows user when I am on Linux), I thought I would try Hobo. Well, Hobo has updated the actionmailer, actionpack, activerecord, activeresource and installed rack. Rails doesn't even use updated versions. But as you can see at the bottom of the track, he uses a stance. I have a feeling it has something to do with my work with the Hobo installation that I removed. Thank you in advance.
[Edit] The
question I asked on the
ActiveScaffold group's
answer (if you don't want to follow the link) was that this line needs to be added to the routes:
map.resources :modelName, :active_scaffold => true
It doesn't fully answer my question, as the documentation doesn't say anything about changing routes. But it works.
[/ Edit]
ActionController :: RoutingError in Departments # index
Display vendor / plugins / active_scaffold / frontends / default / views / _list_header.html.erb where line # 8 is raised:
No route matches {: _method =>: get,: action => "show_search",: controller => "departments"}
Extracted source (around line # 8):
5: <% next if controller.respond_to? link.security_method and !controller.send(link.security_method) -%>
6: <% next if link.action == 'new' && params[:nested].nil? && active_scaffold_config.list.always_show_create %>
7: <% next if link.action == 'show_search' && active_scaffold_config.list.always_show_search %>
8: <%= render_action_link(link, new_params) -%>
9: <% end -%>
10:
11: <%= loading_indicator_tag(:action => :table) %>
Template inclusion tracking: vendor / plugins / active_scaffold / frontends / default / views / list.html.erb
Full trace It was forever to format it. I still don't fully understand SO formatting (sometimes the server doesn't work, reboots are reinstalled, this is the replay server)
source to share
At least for Rails 4+, your config / rout.rb entry should look like this:
resources :models do # my model name in plural
as_routes
# for action links of type member, add the following
# see also [note, via the action-link API, you can change the HTTP verb. Adjust this route accordingly.
# https://github.com/activescaffold/active_scaffold/wiki/Adding-custom-actions
# get :my_custom_action, :on => :member
end
Please note that the following configuration is required to get the correct Gem version in your Gemfile:
gem 'active_scaffold', github: 'activescaffold/active_scaffold', :branch => "3-4-stable"
If you get an error that as_routes was not found; that would be a problem.
source to share