I have fixed mark action. I haven't tried it in 3.x version yet
Also, don't use conf.list.mark_records = true, it wasn't used and I have
removed it. Only add :mark action.
I have updated API
On Martes, 12 de junio de 2012 00:22:53 Andrey Novikov escribió:
> Nick, thanks a lot!
>
> I've added an example to the API:
> List<
https://github.com/activescaffold/active_scaffold/wiki/API:-List>wiki
> page. If you have time and wish, please
> review<
https://github.com/activescaffold/active_scaffold/wiki/API:-List/_co
> mpare/dbd504cf5ac60e79c4ffa4ff26d3bef5d73b5c08...a5f3aecda91a41f4d113fd6a59e
> bc72a10782be8>and fix it (it's incomplete!).
>
> And, anyway, it doesn't work. Checkboxes are checkable, on checkbox click
> the POST request goes to the server (with an OK answer), but if I'm moving
> to the another scaffold page, and return back -- selection
> *sometimes*disappears (and sometimes partially). If I'm calling my method,
> the marked_records method *always* returns empty set. What's wrong now?
> >> :mark_records<
https://groups.google.com/forum/?fromgroups#%21topic/active
> >> :scaffold/btRm42JO9Hk>,>>
> >> in such manner:
> >>
> >> class Admin::Users::AdminsController < Admin::Users::UsersController
> >>
> >> active_scaffold :admin do |conf|
> >>
> >> conf.list.mark_records = true
> >>
> >> end
> >>
> >> end
> >>
> >> Nothing happens (even after server restart). No checkboxes displaying.
> >>
> >> Well, add next part of code:
> >> before_filter :blah
> >>
> >> def blah
> >>
> >> self.class.send :include, ActiveScaffold::Actions::Mark
> >> active_scaffold_config.list.mark_records = true
> >>
> >> end
> >>
> >> Again, nothing. If I'll put debugger into that method - I'll be able to
> >> read the marked_records set and add items to it (and read'em back on next
> >> request).
> >> Well, in the
> >> source<
https://github.com/activescaffold/active_scaffold/blob/master/lib
> >> /active_scaffold/config/mark.rb>I've found the :marked column, try to add
> >> it:
> >>
> >> class Admin::Users::AdminsController < Admin::Users::UsersController
> >>
> >> active_scaffold :admin do |conf|
> >>
> >> conf.list.mark_records = true
> >>
> >> end
> >> before_filter :blah
> >>
> >> def blah
> >>
> >> self.class.send :include, ActiveScaffold::Actions::Mark
> >> active_scaffold_config.list.mark_records = true
> >> active_scaffold_config.list.columns << :marked
> >>
> >> end
> >>
> >> end
> >>
> >> And after that on the next request I've got the fatality:
> >>
> >> RuntimeError in Admin/users/admins#index
> >>
> >> Showing *
> >> /home/envek/.rvm/gems/ruby-1.9.3-p125/bundler/gems/active_scaffold-6fa914
> >> 6cbd52/frontends/default/views/_list_column_headings.html.erb * where
> >> line *#9* raised: