Sergio, thanks a lot! But there is a problem in russian localization - error thrown if select 2 or more records, I've created pull request on github with fix. Other AS localizations seems to work well.
четверг, 14 июня 2012 г., 1:34:57 UTC+10 пользователь Sergio Cambra написал: > > 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? > > > > I've disabled browser cache in firebug, change rails session store from > > cookie to cache, tries to clear rails temp folder. The behavior stays > weird. > > > > My code is: > > > > class PeriodsController < ApplicationController > > active_scaffold :period do |conf| > > conf.list.mark_records = true > > conf.actions.add :mark > > conf.action_links.add :delete_selected, :type => :collection, > :method > > => :delete > > conf.columns = [:date, :published] > > conf.show.link = false > > end > > > > def delete_selected > > logger.debug "Marked records: #{marked_records.count}" > > marked_records.each { |record| record.destroy! } > > head :ok > > end > > > > end > > > > понедельник, 11 июня 2012 г., 23:49:41 UTC+10 пользователь Nick Rogers > > > > написал: > > > conf.actions.add :mark > > > > > > On Mon, Jun 11, 2012 at 6:54 AM, Andrey Novikov <[email protected]> > wrote: > > >> I'm trying to get the mark_records feature work in latest Active > Scaddold > > >> (v3.2.11 and latest master branch commit on Rails 3.2.5), but it > doesn't. > > >> > > >> I'm trying to do it according to the topic Looking for guidance on > > >> > > >> :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: > > >> > > >> Mark is not enabled. Please enable it or remove any references in > your > > >> configuration (e.g. config.mark.columns = [...]). > > >> > > >> > > >> What I'm doing wrong? Where I should enable it actually? Please, > help, if > > >> anybody can. > -- You received this message because you are subscribed to the Google Groups "ActiveScaffold : Ruby on Rails plugin" group. To view this discussion on the web visit https://groups.google.com/d/msg/activescaffold/-/nMCgn2p9BzAJ. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/activescaffold?hl=en.
