Search code examples
ruby-on-railsdeviseactivescaffold

ActiveScaffold vs DeviseInvitable


Using Active Scaffold on devise resource, error appeared after use of devise-invitatible

NameError in Admin/users#index

Showing /home/user/.rvm/gems/ruby-1.9.3-p286/gems/active_scaffold-3.2.16/frontends/default/views/_list_record_columns.html.erb where line #6 raised:

uninitialized constant User::InvitedBy

Extracted source (around line #6):

3:   <% column_value = authorized ? get_column_value(record, column) : active_scaffold_config.list.empty_field_text -%>
4: 
5:   <%= content_tag :td, column_attributes(column, record).merge(:class => column_class(column, column_value, record)) do %>
6:     <%= authorized ? render_list_column(column_value, column, record) : column_value %>
7:   <% end %>
8: <% end -%>

Solution

  • ActiveScaffold 3.2.x doesn't support links for polymorphic associations, you can call clear_link in invited_by column conf.columns[:invited_by].clear_link

    I have disabled those links in rails-3.2 branch, but it will be in 3.2.18. Also you can use gem from git (gem 'active_scaffold', :git => 'git://github.com/activescaffold/active_scaffold) to use master branch which supports links for polymorphic associations.