Giter Site home page Giter Site logo

vhochstein / active_scaffold Goto Github PK

View Code? Open in Web Editor NEW

This project forked from activescaffold/active_scaffold

157.0 157.0 36.0 3.55 MB

Rails 4 Version of activescaffold supporting jquery

License: MIT License

Ruby 70.84% JavaScript 15.37% CSS 2.66% HTML 11.12%

active_scaffold's People

Contributors

adamsalter avatar alsemyonov avatar ameliatester avatar angelic avatar bounga avatar cainlevy avatar danieltennant avatar davec avatar dlepage avatar dustin avatar ewildgoose avatar flavorjones avatar gaffo avatar gnowoel avatar interesse avatar jsurrett avatar jtek avatar kou avatar lackac avatar lukemelia avatar manuelmorales avatar mbbx6spp avatar mcr avatar robd avatar robertlowe avatar shingara avatar shoe avatar timcharper avatar vhochstein avatar yairgo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

active_scaffold's Issues

delete not working

upgraded from rails 2.3.8 to 3.0.0 and switched from 'official' active scaffold branch to this one, using jquery 1.4.1, and everything works except deleting.

seems like its going to the wrong action

Started DELETE "/events?active_scaffold=true&id=3" for 127.0.0.1 at Tue Oct 05 19:18:37 -0700 2010
Processing by EventsController#index as JS
Parameters: {"id"=>"3", "active_scaffold"=>"true"}

shouldn't it be going to the delete action?

ActiveScaffoldExport incompatible with Rails 3 and activescaffold

hi.....
i am trying to upgrade my rails project from 2.3.8 to rails 3.I had used active_scaffold in my rails 2.3.8 version but its not working this time.I went through your post and installed the render_component and verification plugins but still when i am trying to start my server,its throwing an error.I am providing you the complete back trace of the error encountered....

=> Booting WEBrick
=> Rails 3.0.0 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/core_ext/module/aliasing.rb:31:in alias_method': undefined methodoptions' for class ActionController::Resources::Resource' (NameError) from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/core_ext/module/aliasing.rb:31:inalias_method_chain'
from /home/skar/kreeti/meshing/mesh/vendor/plugins/active_scaffold/lib/extensions/resources.rb:20
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in require' from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:inrequire'
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:225:in load_dependency' from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:591:innew_constants_in'
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:225:in load_dependency' from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:inrequire'
from /home/skar/kreeti/meshing/mesh/vendor/plugins/active_scaffold/environment.rb:4
from /home/skar/kreeti/meshing/mesh/vendor/plugins/active_scaffold/environment.rb:4:in each' from /home/skar/kreeti/meshing/mesh/vendor/plugins/active_scaffold/environment.rb:4 from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:inrequire'
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in require' from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:225:inload_dependency'
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:591:in new_constants_in' from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:225:inload_dependency'
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in require' from /home/skar/kreeti/meshing/mesh/vendor/plugins/active_scaffold/init.rb:8 from /usr/lib/ruby/gems/1.8/gems/railties-3.0.0/lib/rails/plugin.rb:81 from /usr/lib/ruby/gems/1.8/gems/railties-3.0.0/lib/rails/initializable.rb:25:ininstance_exec'
from /usr/lib/ruby/gems/1.8/gems/railties-3.0.0/lib/rails/initializable.rb:25:in run' from /usr/lib/ruby/gems/1.8/gems/railties-3.0.0/lib/rails/initializable.rb:50:inrun_initializers'
from /usr/lib/ruby/gems/1.8/gems/railties-3.0.0/lib/rails/initializable.rb:49:in each' from /usr/lib/ruby/gems/1.8/gems/railties-3.0.0/lib/rails/initializable.rb:49:inrun_initializers'
from /usr/lib/ruby/gems/1.8/gems/railties-3.0.0/lib/rails/application.rb:134:in initialize!' from /usr/lib/ruby/gems/1.8/gems/railties-3.0.0/lib/rails/application.rb:77:insend'
from /usr/lib/ruby/gems/1.8/gems/railties-3.0.0/lib/rails/application.rb:77:in method_missing' from /home/skar/kreeti/meshing/mesh/config/environment.rb:5 from /home/skar/kreeti/meshing/mesh/config.ru:3:inrequire'
from /home/skar/kreeti/meshing/mesh/config.ru:3
from /usr/lib/ruby/gems/1.8/gems/rack-1.2.1/lib/rack/builder.rb:46:in instance_eval' from /usr/lib/ruby/gems/1.8/gems/rack-1.2.1/lib/rack/builder.rb:46:ininitialize'
from /home/skar/kreeti/meshing/mesh/config.ru:1:in `new'
from /home/skar/kreeti/meshing/mesh/config.ru:1

plz hlp..........

RJS error (element is null) when inplace editing an element in a sub-list

I don't know whether this is a problem in the Rails 3 branch or with ActiveScaffold in general, but ...

If I try to in-place-edit an element in a sub-list, the update actually occurs but the browser continues to show "Saving ..." and an "RJS TypeError: element is null" occurs. Another error message follows, "ActiveScaffold.replace_html("as_players-update_column-3-name-cell", "Alan Anderson");"

I think what is happening is that the element, name for example, in the sub-list has the id as_teams_1_players-update_column-1-name-cell rather than as_players-update_column-1-name-cell, so the HTML does not get updated and an error occurs.

You can demonstrate this by starting with the "Howto" demo and adding
conf.columns[:name].inplace_edit = true
to players_controller.rb and
has_many :players
to team.rb. Create a team, add a player, then try to edit the player's name in the sub-list.

Error incompatible character encodings: ASCII-8BIT and UTF-8

I am getting this error when I try to display anything with a Unicode character such as a character with an accent. Everything works fine when I use a standard template, but if I switch to an AS one, I get this error. Everything is defined as UTF-8 and I have verified that I'm getting a UTF-8 string from the DB, i.e. Country.find(16).name.encoding gives #Encoding:UTF-8.

I can display with ActiveScaffold if I make a virtual column, such as name2, where name2=name.force_encoding('utf-8') -- that does work. I can only conclude that the problem is somewhere in AS, since everything works properly without it but not with it ... of course, that is no proof!

I'm using Rails 3.0, MySQL, and mysql2 adapter.

:list doesn't work without :nested enabled

conf.actions = [:field_search, :list, :show, :subform]

Showing /home/korobkov/work/devel/brisbane/vendor/plugins/active_scaffold/frontends/default/views/_list_header.html.erb where line #6 raised:

undefined local variable or method `nested' for #<#<Class:0x00000005239600>:0x00000005237418>

Extracted source (around line #6):

3:   <div class="actions">
4:     <%= render :partial => 'action_group', :locals => {:action_links => action_links,
5:                                                        :url_options => params_for,
6:                                                        :traverse_options => nested.nil? ? {} : {:reverse => true}} %>
7:     <%= loading_indicator_tag(:action => :table) %>
8:   </div>
9: <% end %>

With conf.actions = [:field_search, :list, :nested, :show, :subform] it works...
May be, some checking for nested.nil? would help?

Class names end in space character -- intentional?

On a list view, the class names for columns are ending in a " " blank character, like this:

<td class="contacts-column ">

Is this intentional? Also, on the Show view, the <dd> classes begin with a quote character,

<dd class="&quot;name-view" &quot;="">

Crash with RJS error (element is null) when closing "show" subform

Start with the example setup of teams and players.

Add to players_controller, "config.columns[:team].actions_for_association_links = [:show]"

[NB: The generator apparently uses |conf| instead of |config| when it sets up controllers. This can lead to a lot of frustration for new users (like me) since the documentation always refers to "config"]

Enter a player and a team. Browse .../players. Click on the team name in the list, to bring up the Show box. Now, if you click on the x icon to close the box, it works. If you click on the Close button, you get a messy error screen.

custom ajax action_link doesn't work if action method is nt calling render

I'm adding a new custom action link to my controller. I've added a blank method and html.erb for the action link but get an error when I click the "Remove Device" link.
Here is my controller:

class CabinetPositionsController < ApplicationController
  active_scaffold :cabinet_position do |conf|
    label = "Positions"
    action_links.add 'remove_device', :label => 'Remove Device', :crud_type => :update, :type => :member
    list.sorting = {:name => 'ASC'}
    columns[:device].actions_for_association_links = [:show]
  end

  def remove_device

  end
end

First few lines I got from the trace result:
NoMethodError in Cabinet positionsController#remove_device

undefined method `merge' for nil:NilClass

Rails.root: /Users/jiangle/project/rails/dcrm
Application Trace | Framework Trace | Full Trace

activesupport (3.0.3) lib/active_support/whiny_nil.rb:48:in `method_missing'
vendor/plugins/active_scaffold/lib/extensions/action_controller_rendering.rb:9:in `render'
actionpack (3.0.3) lib/action_controller/metal/implicit_render.rb:10:in `default_render'
actionpack (3.0.3) lib/action_controller/metal/implicit_render.rb:5:in `send_action'
actionpack (3.0.3) lib/abstract_controller/base.rb:151:in `process_action'
actionpack (3.0.3) lib/action_controller/metal/rendering.rb:11:in `process_action'
actionpack (3.0.3) lib/abstract_controller/callbacks.rb:18:in `process_action'
activesupport (3.0.3) lib/active_support/callbacks.rb:465:in `_run__1646989264__process_action__238293908__callbacks'
activesupport (3.0.3) lib/active_support/callbacks.rb:409:in `send'
activesupport (3.0.3) lib/active_support/callbacks.rb:409:in `_run_process_action_callbacks'
activesupport (3.0.3) lib/active_support/callbacks.rb:93:in `send'
activesupport (3.0.3) lib/active_support/callbacks.rb:93:in `run_callbacks'
actionpack (3.0.3) lib/abstract_controller/callbacks.rb:17:in `process_action'
actionpack (3.0.3) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
activesupport (3.0.3) lib/active_support/notifications.rb:52:in `instrument'
activesupport (3.0.3) lib/active_support/notifications/instrumenter.rb:21:in `instrument'
activesupport (3.0.3) lib/active_support/notifications.rb:52:in `instrument'
actionpack (3.0.3) lib/action_controller/metal/instrumentation.rb:29:in `process_action'
actionpack (3.0.3) lib/action_controller/metal/rescue.rb:17:in `process_action'
actionpack (3.0.3) lib/abstract_controller/base.rb:120:in `process'
actionpack (3.0.3) lib/abstract_controller/rendering.rb:40:in `process'
actionpack (3.0.3) lib/action_controller/metal.rb:138:in `dispatch'
actionpack (3.0.3) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
actionpack (3.0.3) lib/action_controller/metal.rb:178:in `action'
actionpack (3.0.3) lib/action_dispatch/routing/route_set.rb:62:in `call'
actionpack (3.0.3) lib/action_dispatch/routing/route_set.rb:62:in `dispatch'
actionpack (3.0.3) lib/action_dispatch/routing/route_set.rb:27:in `call'
rack-mount (0.6.13) lib/rack/mount/route_set.rb:148:in `call'
rack-mount (0.6.13) lib/rack/mount/code_generation.rb:93:in `recognize'
rack-mount (0.6.13) lib/rack/mount/code_generation.rb:124:in `optimized_each'
rack-mount (0.6.13) lib/rack/mount/code_generation.rb:92:in `recognize'
rack-mount (0.6.13) lib/rack/mount/route_set.rb:139:in `call'
actionpack (3.0.3) lib/action_dispatch/routing/route_set.rb:492:in `call'
actionpack (3.0.3) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
actionpack (3.0.3) lib/action_dispatch/middleware/head.rb:14:in `call'
rack (1.2.1) lib/rack/methodoverride.rb:24:in `call'
actionpack (3.0.3) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
actionpack (3.0.3) lib/action_dispatch/middleware/flash.rb:182:in `call'
actionpack (3.0.3) lib/action_dispatch/middleware/session/abstract_store.rb:149:in `call'
actionpack (3.0.3) lib/action_dispatch/middleware/cookies.rb:295:in `call'
activerecord (3.0.3) lib/active_record/query_cache.rb:32:in `call'
activerecord (3.0.3) lib/active_record/connection_adapters/abstract/query_cache.rb:28:in `cache'
activerecord (3.0.3) lib/active_record/query_cache.rb:12:in `cache'
activerecord (3.0.3) lib/active_record/query_cache.rb:31:in `call'
activerecord (3.0.3) lib/active_record/connection_adapters/abstract/connection_pool.rb:353:in `call'
actionpack (3.0.3) lib/action_dispatch/middleware/callbacks.rb:46:in `call'
activesupport (3.0.3) lib/active_support/callbacks.rb:415:in `_run_call_callbacks'
actionpack (3.0.3) lib/action_dispatch/middleware/callbacks.rb:44:in `call'
rack (1.2.1) lib/rack/sendfile.rb:107:in `call'
actionpack (3.0.3) lib/action_dispatch/middleware/remote_ip.rb:48:in `call'
actionpack (3.0.3) lib/action_dispatch/middleware/show_exceptions.rb:46:in `call'
railties (3.0.3) lib/rails/rack/logger.rb:13:in `call'
rack (1.2.1) lib/rack/runtime.rb:17:in `call'
activesupport (3.0.3) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.2.1) lib/rack/lock.rb:11:in `call'
rack (1.2.1) lib/rack/lock.rb:11:in `synchronize'
rack (1.2.1) lib/rack/lock.rb:11:in `call'
actionpack (3.0.3) lib/action_dispatch/middleware/static.rb:30:in `call'
railties (3.0.3) lib/rails/application.rb:168:in `call'
railties (3.0.3) lib/rails/application.rb:77:in `send'
railties (3.0.3) lib/rails/application.rb:77:in `method_missing'
railties (3.0.3) lib/rails/rack/log_tailer.rb:14:in `call'
rack (1.2.1) lib/rack/content_length.rb:13:in `call'
rack (1.2.1) lib/rack/handler/webrick.rb:52:in `service'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
rack (1.2.1) lib/rack/handler/webrick.rb:13:in `run'
rack (1.2.1) lib/rack/server.rb:213:in `start'
railties (3.0.3) lib/rails/commands/server.rb:65:in `start'
railties (3.0.3) lib/rails/commands.rb:30
railties (3.0.3) lib/rails/commands.rb:27:in `tap'
railties (3.0.3) lib/rails/commands.rb:27
script/rails:6:in `require'
script/rails:6

activesupport (3.0.3) lib/active_support/whiny_nil.rb:48:in `method_missing'
vendor/plugins/active_scaffold/lib/extensions/action_controller_rendering.rb:9:in `render'
actionpack (3.0.3) lib/action_controller/metal/implicit_render.rb:10:in `default_render'
actionpack (3.0.3) lib/action_controller/metal/implicit_render.rb:5:in `send_action'
actionpack (3.0.3) lib/abstract_controller/base.rb:151:in `process_action'

The version of active_scaffold is commit 93ee64b. Rails 3.0.3

Helper customization spreading to all models

To create a customized sub-form for the name column of one model, I put

def name_form_column(record,params)
  ... customized code ...
end

into members_helper.rb. It works fine, but the same customized code is now being used for all the models with a name field. Since the override is defined in one model's helper file, should it not automatically be limited to that model?

another i18n error

when set
config.i18n.default_locale = :de #or :ja, :es
the error still occurs as following:
TypeError (can't convert String into Hash):


this error could by fixed by remove '.merge(as_(:date_picker_options))' in line 78 and line 91 of the file "active_scaffold/lib/active_scaffold/bridges/date_picker/lib/datepicker_bridge.rb"

67 date_picker_options = { :closeText => as_(:close),
68 :prevText => as_(:previous),
69 :nextText => as_(:next),
70 :currentText => as_(:today),
71 :monthNames => date_options[:month_names][1, (date_options[:month_names].length - 1)],
72 :monthNamesShort => date_options[:abbr_month_names][1, (date_options[:abbr_month_names].length - 1)],
73 :dayNames => date_options[:day_names],
74 :dayNamesShort => date_options[:abbr_day_names],
75 :dayNamesMin => date_options[:abbr_day_names],
76 :changeYear => true,
77 :changeMonth => true,
78 } #.merge(as_(:date_picker_options))

87 datetime_picker_options = {:ampm => false,
88 :hourText => datetime_options[:hour],
89 :minuteText => datetime_options[:minute],
90 :secondText => datetime_options[:second],
91 } #.merge(as_(:datetime_picker_options))

i18n error!

rails g active_scaffold_setup jquery
when set
config.i18n.default_locale = :de #or :ja, :es

in config/application.rb, the error will come as following:

TypeError in PlayersController#index

can't convert Symbol into Integer

Rails.root: /home/sdr/workspace/howto
Application Trace | Framework Trace | Full Trace

app/controllers/players_controller.rb:2:in <class:PlayersController>' app/controllers/players_controller.rb:1:in<top (required)>'

vendor/plugins/active_scaffold/lib/active_scaffold/bridges/date_picker/lib/datepicker_bridge.rb:71:in []' vendor/plugins/active_scaffold/lib/active_scaffold/bridges/date_picker/lib/datepicker_bridge.rb:71:indate_options'
vendor/plugins/active_scaffold/lib/active_scaffold/bridges/date_picker/lib/datepicker_bridge.rb:54:in localization' vendor/plugins/active_scaffold/lib/active_scaffold/bridges/date_picker/bridge.rb:12:inblock (2 levels) in <top (required)>'
vendor/plugins/active_scaffold/lib/active_scaffold/bridges/bridge.rb:36:in call' vendor/plugins/active_scaffold/lib/active_scaffold/bridges/bridge.rb:36:inrun'
vendor/plugins/active_scaffold/lib/active_scaffold/bridges/bridge.rb:42:in block in run_all' vendor/plugins/active_scaffold/lib/active_scaffold/bridges/bridge.rb:41:ineach'
vendor/plugins/active_scaffold/lib/active_scaffold/bridges/bridge.rb:41:in run_all' vendor/plugins/active_scaffold/lib/active_scaffold.rb:59:inactive_scaffold'
activesupport (3.0.1) lib/active_support/dependencies.rb:454:in load' activesupport (3.0.1) lib/active_support/dependencies.rb:454:inblock in load_file'
activesupport (3.0.1) lib/active_support/dependencies.rb:591:in new_constants_in' activesupport (3.0.1) lib/active_support/dependencies.rb:453:inload_file'
activesupport (3.0.1) lib/active_support/dependencies.rb:340:in require_or_load' activesupport (3.0.1) lib/active_support/dependencies.rb:491:inload_missing_constant'
activesupport (3.0.1) lib/active_support/dependencies.rb:183:in block in const_missing' activesupport (3.0.1) lib/active_support/dependencies.rb:181:ineach'
activesupport (3.0.1) lib/active_support/dependencies.rb:181:in const_missing' activesupport (3.0.1) lib/active_support/inflector/methods.rb:124:inblock in constantize'
activesupport (3.0.1) lib/active_support/inflector/methods.rb:123:in each' activesupport (3.0.1) lib/active_support/inflector/methods.rb:123:inconstantize'
activesupport (3.0.1) lib/active_support/dependencies.rb:523:in block in <class:Reference>' activesupport (3.0.1) lib/active_support/dependencies.rb:533:inyield'
activesupport (3.0.1) lib/active_support/dependencies.rb:533:in default' activesupport (3.0.1) lib/active_support/dependencies.rb:533:inget'
actionpack (3.0.1) lib/action_dispatch/routing/route_set.rb:58:in controller_reference' actionpack (3.0.1) lib/action_dispatch/routing/route_set.rb:44:incontroller'
actionpack (3.0.1) lib/action_dispatch/routing/route_set.rb:23:in call' rack-mount (0.6.13) lib/rack/mount/route_set.rb:148:inblock in call'
rack-mount (0.6.13) lib/rack/mount/code_generation.rb:93:in block in recognize' rack-mount (0.6.13) lib/rack/mount/code_generation.rb:117:inoptimized_each'
rack-mount (0.6.13) lib/rack/mount/code_generation.rb:92:in recognize' rack-mount (0.6.13) lib/rack/mount/route_set.rb:139:incall'
actionpack (3.0.1) lib/action_dispatch/routing/route_set.rb:492:in call' actionpack (3.0.1) lib/action_dispatch/middleware/best_standards_support.rb:17:incall'
actionpack (3.0.1) lib/action_dispatch/middleware/head.rb:14:in call' rack (1.2.1) lib/rack/methodoverride.rb:24:incall'
actionpack (3.0.1) lib/action_dispatch/middleware/params_parser.rb:21:in call' actionpack (3.0.1) lib/action_dispatch/middleware/flash.rb:182:incall'
actionpack (3.0.1) lib/action_dispatch/middleware/session/abstract_store.rb:149:in call' actionpack (3.0.1) lib/action_dispatch/middleware/cookies.rb:287:incall'
activerecord (3.0.1) lib/active_record/query_cache.rb:32:in block in call' activerecord (3.0.1) lib/active_record/connection_adapters/abstract/query_cache.rb:28:incache'
activerecord (3.0.1) lib/active_record/query_cache.rb:12:in cache' activerecord (3.0.1) lib/active_record/query_cache.rb:31:incall'
activerecord (3.0.1) lib/active_record/connection_adapters/abstract/connection_pool.rb:355:in call' actionpack (3.0.1) lib/action_dispatch/middleware/callbacks.rb:46:inblock in call'
activesupport (3.0.1) lib/active_support/callbacks.rb:415:in _run_call_callbacks' actionpack (3.0.1) lib/action_dispatch/middleware/callbacks.rb:44:incall'
rack (1.2.1) lib/rack/sendfile.rb:107:in call' actionpack (3.0.1) lib/action_dispatch/middleware/remote_ip.rb:48:incall'
actionpack (3.0.1) lib/action_dispatch/middleware/show_exceptions.rb:46:in call' railties (3.0.1) lib/rails/rack/logger.rb:13:incall'
rack (1.2.1) lib/rack/runtime.rb:17:in call' activesupport (3.0.1) lib/active_support/cache/strategy/local_cache.rb:72:incall'
rack (1.2.1) lib/rack/lock.rb:11:in block in call' <internal:prelude>:10:insynchronize'
rack (1.2.1) lib/rack/lock.rb:11:in call' actionpack (3.0.1) lib/action_dispatch/middleware/static.rb:30:incall'
railties (3.0.1) lib/rails/application.rb:168:in call' railties (3.0.1) lib/rails/application.rb:77:inmethod_missing'
railties (3.0.1) lib/rails/rack/log_tailer.rb:14:in call' rack (1.2.1) lib/rack/content_length.rb:13:incall'
rack (1.2.1) lib/rack/handler/webrick.rb:52:in service' /home/sdr/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/webrick/httpserver.rb:111:inservice'
/home/sdr/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/webrick/httpserver.rb:70:in run' /home/sdr/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/webrick/server.rb:183:inblock in start_thread'

Reset on :field_search causes error

I added :field_search to a controller and it works fine except that clicking "Reset" either in the search menu or in the resulting list leads to a "500" error. The server output shows:
Started GET "/members?utf8=%E2%9C%93&search=" for
Processing by MembersController#index as JS
Parameters: {"utf8"=>"G£ô", "search"=>""}
NoMethodError (undefined method `each' for "":String):
(Sometimes the utf8 part is not there). This happens with or without the human_conditions added (which is a really nice feature!).

More on error message methods needed (#33)

Issue 33 is closed but I have made another comment on it ... not sure if it should go there or in a new issue here so I'll copy the comment here:

Still not working well. The problem is that the ActiveScaffold controllers (at least, the delete action that I'm working with) do not use the error messages from the record:

def do_destroy
  destroy_find_record
  begin
    self.successful = @record.destroy
  rescue
    flash[:warning] = as_(:cant_destroy_record, :record => @record.to_label)
    self.successful = false
  end
end

What I am trying to do is to prevent deletion of certain records, using before_destroy:. I am doing the error checking in the model therefore, not the controller, and I don't think I have access to flash there. A previous post said to use

errors.add(<attribute>, <message>)

in a similar situation so that is what I have done, but it's not picked up by do_destroy. Furthermore, do_destroy only outputs the error message if an exception is raised, so my member before destroy method needs to add the error message, then raise an exception.

I've added an override do_destroy method

def do_destroy
  @record = find_if_allowed(params[:id], :delete)
  begin
    self.successful = @record.destroy
  rescue
    flash[:warning] = as_(:cant_destroy_record, :record => @record.to_label)
    flash[:warning] << " because #{@record.errors[:delete]}"
    self.successful = false
  end
end

but it would be nice if I could simply add error messages to the model and have them displayed automatically.

rails3: cannot make to work with ajax

Hi, I have successfully installed the plugin and it works fine. But then I noticed that in the demo (http://demo.activescaffold.com/users) almost everything work with ajax (creating new item, sorting and so on) and in my project each action reloads the page.
First I had javascript error in rails.js "document.on is not a function" and I have fixed that by wrapping the code with
document.observe("dom:loaded", function() {
// --- all functions with document.on
})
and the error was gone but it didn't solve my problem with ajax.

So my environment:
windows xp (ubuntu 10.04 has the same problem)
rails 3.0.1
ruby 1.8.7
mozilla firefox, chrome

I have triple checked that all javascript are included, no javascirpt errors and some problems with blocking javascript, nothing like that.
I have also noticed that in the demo in the titles all links have onclick function and in my project -no. But it has attributes "data-remote='true'" and that is why I think it should be with ajax.

Thanks

Link still inline despite "config.show.link.inline = false"

I've used config.show.link.inline = false for a link but it is not opening up the link when clicked. It works when "open in new tab" is selected in the browser. I think this is because the link tag still has data-remote="true" in it.

Initial error

Search and general display seems to work on a clean install and configuration, but on clicking new (using jQuery configuration), I get the following error:

undefined method `errors' for :record:Symbol
Extracted source (around line #4):

1: <%= render :partial => 'messages' %>
2:
3: <% unless @record.nil? %>
4: <%= error_messages_for :record, :object_name => @record.class.model_name.human.downcase %>
5: <% end %>
Trace of template inclusion: vendor/plugins/active_scaffold/frontends/default/views/_base_form.html.erb, vendor/plugins/active_scaffold/frontends/default/views/_create_form.html.erb, vendor/plugins/active_scaffold/frontends/default/views/create.html.erb

form overrides

seems that when you do the standard described on the as wiki using :record and :field name, it breaks when the models are used in subforms. this is what I have found to work best retaining label associations,

text_area options[:name].gsub("[answer]", ""), :answer, :rows => 2, :cols => 50, :value => record.answer

but there must be a better way? this seems like a hack and shouldn't work like this.

EDIT: ok it does not preserve label associations, those get broken as well.

Is "send_form_on_update_column" implemented in this fork?

I am trying to update a field based on a field that was changed and another field. Since AS usually only send the value of the changed column, I need other values to render the updated columns, and therefore need to enable send_form_on_update_column so that all the form will be sent. It does not seem that this feature has made the cut. Can this be implemented?

See: https://github.com/activescaffold/active_scaffold/wiki/Chaining-Form-Fields

ActiveRecordPermissions

I am trying to add security methods so I declared:
def authorized_for_delete?
end
in my model but it was never called.
ActiveRecordPermissions::Permissions::SecurityMethods should be included in ActiveRecord but it seems it is included the wrong way as all the methods are applied to the Class. So the function could be called only as singleton self. authorized_for_delete? which is not the desired functionality.

I forked your fork :) and I am giving a look. If you have any hints it would be great to share. Thank for this fork and all additions to AS!

DatePicker bridge does bad things.

The install method for this bridge attempts to do file I/O (cp/rm) and this has two problems:

  1. The test it's doing to decide whether or not the JS file should exist sometimes seems to produce different results. I.E. sometimes it will try to remove the file, sometimes it will try to add it -- even though we have js_framework set to :jquery per the setup instructions. Order-of-operations inconsistency perhaps?

  2. Copying files around should be done via the active_scaffold_setup generator -- if the concern is to facilitate testing changes to the relevant files, then perhaps the I/O ops should be constrained to dev mode, not test/production (as these may be executed on systems like Heroku where one does not have a writeable FS).

ActiveScaffold.create_associated_record_form has an error (contains fix)

Line 625 of jquery version of "active_scaffold/frontends/default/javascripts/jquery/active_scaffold.js" tryes to use "$(options.id)" to see if a DOM object already exists, but the syntax is not updated fot jquery.

Fix:
vi active_scaffold/frontends/default/javascripts/jquery/active_scaffold.js +625

  • if (!(options.id && $(options.id))) {
  • if (!(options.id && $('#' + options.id).size() > 0)) {

nested link doesn't work

Hi,
I followed your steps on http://vhochstein.wordpress.com/2010/08/28/setup-activescaffold-rails-3/ to create a howto rails 3 project. The javascript framework I choose is jquery when setup active_scaffold. Everything works but the nested link of players. I’ve created a team with 3 players. But when I click the players nested link the players list doesn’t not always appear.
I tried quite a few times. This is quite strange. And if I click nested players link after click edit and then cancel it, the players list always appears.

activescaffold is the latest commit on Nov 26th
MacOS 10.6.5
Rails 3.0.3
ruby 1.8.7 (2009-06-12 patchlevel 174)
Firefox 3.6.12

Error when using inplace_edit = :ajax with HABTM associations and unchecking all options

After submitting an in place AJAX form consisting of a collection of checkboxes (plural association) I get the following error:
NoMethodError (private methodselect' called for "2":String)`
It seems that instead of array it submits only the value of the first checkbox.

Example models and controllers:

class Post < ActiveRecord::Base
  has_and_belongs_to_many :categories
end

class Category < ActiveRecord::Base
  has_and_belongs_to_many :posts
end

class PostsController < ApplicationController
  active_scaffold :post do |conf|
    columns[:categories].inplace_edit = :ajax
  end
end

class CategoriesController < ApplicationController
  active_scaffold :category do |conf|
  end
end

I'm using Rails 3.0.3 with jQuery, Ruby 1.9.3 on Linux

Thanks

Multi layer belongs_to

Hi folks
i have 3 simple models
class Region < ActiveRecord::Base
has_many :cities
has_many :schools, :through => :cities
end

class City < ActiveRecord::Base
  belongs_to :region
  has_many :schools
end

class School < ActiveRecord::Base
  belongs_to :city
end
  1. How to define SchoolsController activescaffold config to add region column?
  2. at SchoolsController is it possible have all columns (region and city) add an school and choose region first and scoped city (after changed region)

Associations problem

Hi, for activescaffold I'm using controllers with the prefix "as", so I added next to my ApplicationController:

protected

def self.active_scaffold_controller_for(klass)
return UserManagementController if klass == User
return AsProfilesController if klass == Profile
return "#{klass}ScaffoldController".constantize rescue super
end

And it worked,
Here is my profile controller
class AsProfilesController < AdministratorsController
before_filter :require_admin
active_scaffold :profile do |config|
config.columns.exclude :objective
config.columns << :user
config.columns[:user].label = "Coach"
config.columns.exclude :id
end
end

And user_management controller

class UserManagementController < AdministratorsController
before_filter :require_admin

active_scaffold :user do |config|
config.columns = [:email, :first_name, :last_name, :title, :roles, :enterprise, :deleted_at, :profile]
config.create.columns.exclude :id
config.update.columns.exclude :id
end

end

So when I open users page I have column with profiles
Starting from here I have all my problems

  1. I can click the profile link for particular user and I will see the profile form but once I click update it adds the profile record in the users table (supposed just to close the form)
  2. If user has no profile then there is "Create new" link instead of profile, so I can click it and the form for new profile appears, I type some data and click Create, validation error message appears (User can't be blank)
    I have validates :user, :presence => true in my Profile model

And I have often noticed that updating a model through association doesn't initiate updating info on the screen, only after completaly page reload.

I'm not sure if this is due to controller names, I have no exceptions and I didn't change something inside of the plugin but I'm have all those problems with updating data using associations.

Please help :)

localize bug: I18n.translate ---- I18n.translate!

line 4 in 'active_scaffold/lib/extensions/localize.rb'
text = I18n.translate "#{key}", {:scope => [:active_scaffold], :default => key.is_a?(String) ? key : key.to_s.titleize}.merge(options)
should be
text = I18n.translate! "#{key}", {:scope => [:active_scaffold], :default => key.is_a?(String) ? key : key.to_s.titleize}.merge(options)

Does auto_complete plugin work?

I'm trying to get the auto_complete plugin to work with a Rails 3/ActiveScaffold project, but haven't had any success yet. I'm not sure whether I'm doing something wrong or if it's not supported in this fork. If it's supported, is there an example somewhere? Thanks.

error when doing rails g active_acaffold_setup

Im tryng to set it up but getting this error: c:/Ruby187/lib/ruby/1.8/net/http.rb:586:in `connect': SSL_connect returned=1 err
no=0 state=SSLv3 read server certificate B: certificate verify failed (OpenSSL::
SSL::SSLError)

any ideas why?

Functional testing fails

Running "rake test" on the sample teams-players setup fails in the functional tests. One problem is that the create and update tests use "post :create, :player => @player.attributes" (same for :update), while the controller seems to be expecting "post :create, :record => @player.attributes". I haven't traced the other error, where test_should_get_index gets a nil object.

Are there any guidelines, examples, or discussion of how to develop good functional tests for ActiveScaffold controllers?

uninitialized constant ActiveScaffold::Helpers::IdHelpers

Hi,
I tried using active_scaffold with rails 3 and ruby 1.9.2 but I get this error when I try to start the server:

/Users/john/.rvm/gems/ruby-1.9.2-p0/gems/active_scaffold-3.0.2/lib/active_scaffold/helpers/controller_helpers.rb:8:in `module:ControllerHelpers': uninitialized constant ActiveScaffold::Helpers::IdHelpers (NameError)

search option not working in active scaffold

i have a companies controller using active active scaffold.On clicking the search link the search box in the list view is opening in a different page.i jst cnt understand what's causing this problem.Is this a routing problem?I have used as_routes in my routes.rb file,and using rails 3.0.0 and ruby 1.8.7.I am new to rails,and i am badly stuck in this section.plz hlp.

belongs_to problem

Hi, I have rails3, jQuery and activescaffold and it worked fine while I had simpel models.
To simplify the problem I will operate only two models: User and Enterprise
So User belongs_to Enterprise
Enterprise has_many users
validateion inside of a user: validates :enterprise, :presence => true

So when I try to create new user I see the drop down with existing enterprises and able to add new one. So I select existing one and click "Create" and see validation error message "enterprise can't be blank"
Firebug shows that it passes associated_id to server (not sure what does it mean but the value is the id of enterprise)
So I have not javascirpt errors, no exceptions it just doesn't see selected enterprise on the server.

The same problem with the roles (User has_many: rolse)

I think maybe there is something that I missed because Enterprise has_many users and it works fine but cannot figure out the issue by myself.
Please help

Unable to render :active_scaffold partials

I'm using the current head from git (along with the forked render_component etc)
Active scaffold is working when I load a stand alone controller, but whenever I try to render it from a view, eg:

<%= render :active_scaffold => 'admin/agent' -%>

I get the following error:
ActionView::Template::Error (undefined method `formats' for nil:NilClass):
1: = render :active_scaffold => 'admin/agent'
app/views/test/index.haml:1:in _app_views_test_index_haml__226741202_88287490_654131706'

I'm not sure if this is a bug in the fork or with Rails 3, but this was working previously on Rails 2.3 and the current main active scaffold branch.

For some reason, rails isn't giving a decent stack trace of where in active scaffold the error is occurring, so let me know if there
any other information I could provide to help track the cause of this down.

Cheers
Dave Smylie

column subgroups don't accept non-ASCII symbols

/home/korobkov/work/devel/perth/app/controllers/book_descriptions_controller.rb:34: invalid multibyte char (US-ASCII)
/home/korobkov/work/devel/perth/app/controllers/book_descriptions_controller.rb:34: invalid multibyte char (US-ASCII)
/home/korobkov/work/devel/perth/app/controllers/book_descriptions_controller.rb:34: syntax error, unexpected $end, expecting ')'
...create.columns.add_subgroup("а�аГаЛаАаВаЛаЕаНаИаЕ аИ б�аКаАа...

Setting # encoding: utf-8 at the first line of file does help, but the strange thing is without this line UTF-8 is rejected only in subgroup! When I set conf.label = "some non-ASCII chars" it works even without this line!

config.encoding = "utf-8" is set in application.rb.

ruby 1.9.2, rails 3.0.3, AS - the latest commit from git master branch.

What's with custom :nested action_links for columns?

Thanks for the plugin.
I've used it before for rails 2.3 and configured nested links like this:

as.columns[:some_column].set_link(:nested, :parameters => {:associations => :some_association})

All was fine until I've switched to Rails 3 fork. Now it reports error message about missing :nested route. I think, it's related to moving tovards pure REST (with nested resources routes instead of :nested action).
The question is what should I write now to have the same effect (yes, I've read your blog about setting nested links, but that was about standalone links in the actionlinks section of page; now I am speaking about nested link, attached to column)?
If some helper in AS could generate right code for standalone link, I guess that should be somewhere a piece of code to do the same thing for column link... How should I call it?

Prototype: "Create Another" Link Does Nothing in Subforms

Given these models:

class User < ActiveRecord::Base
belongs_to :group
end

class UserGroup < ActiveRecord::Base
has_many :users, :dependent => :destroy
end

and these controllers:

class UserGroupsController < ApplicationController
active_scaffold :user_group
end

class UsersController < ApplicationController
active_scaffold :user
end

In the User subform within the create/edit pages for UserGroups, the "create another" button does nothing. No warnings, no javascript errors, no application errors. Any ideas?

Cannot use form_ui

I tried to use a radio button in form_ui but it will display the html characters. I tried to locate the line where the form is rendered and use <%= raw %> but did not have much luck.
Is the file _horizontal_subform_record.html.erb the correct one?

nested.add_link not doing anything

Perhaps I don't understand the nested.add_link feature. I have, for example,
class Member < ActiveRecord::Base
belongs_to :bloodtype
...

class Bloodtype < ActiveRecord::Base
  has_many :members
...

and I am trying to have a nested link to members in the list of bloodtypes, so it would look like, for example, "| Type O+ | Members Edit Delete Show |

Putting config.nested.add_link('Members',[:members]) into bloodtypes.controller does not seem do do anything. I can simply show the Members column within the list and by default it provides the same functionality of opening a nested list when clicked, but I can't seem to create that link in the actions with add_link.

Hardcoded prototype's "Ajax" in a view render's an error when used with jquery (contains fix)

Line 30 of "active_scaffold/frontends/default/views/_form_association_footer.html.erb" hardcodes prototype's "Ajax" and renders an error when used with jquery

Fix:
vi active_scaffold/frontends/default/views/_form_association_footer.html.erb +30

REMOVE THIS LINE - (30)
<%= link_to_record_select as_(:add_existing), remote_controller.controller_path, :onselect => "new Ajax.Request(#{edit_associated_url.to_json}.sub('--ID--', id), {asynchronous: true, evalScripts: true, onFailure: function(){ActiveScaffold.report_500_response(#{active_scaffold_id.to_json})}});" -%>

AND ADD THIS + http://pastie.org/1220735
<%
if ActiveScaffold.js_framework == :prototype
onselect = <<DOC
new Ajax.Request(
#{edit_associated_url.to_json}.sub('--ID--', id), {
asynchronous: true,
evalScripts: true,
onFailure: function(){
ActiveScaffold.report_500_response(#{active_scaffold_id.to_json})
}
}
);
DOC
elsif ActiveScaffold.js_framework == :jquery
onselect = <<DOC
$.ajax({
url: #{edit_associated_url.to_json}.split('--ID--').join(id),
error: function(xhr, textStatus, errorThrown){
ActiveScaffold.report_500_response(#{active_scaffold_id.to_json})
}
});
DOC
end
onselect = onselect.gsub(/\n/, ' ')
%>

    <%= link_to_record_select as_(:add_existing), remote_controller.controller_path, :onselect => onselect -%>

Strange behavior with list nested in list

Given this setup based on "howto"

class Player < ActiveRecord::Base
  belongs_to :team
end

class Team < ActiveRecord::Base
  has_many :players
end

class TeamsController < ApplicationController
  active_scaffold :team do |config|
      list.columns = [:name, :players, :position]
  end
end

class PlayersController < ApplicationController
  active_scaffold :player do |config|
    list.columns = [:name, :team]
    config.columns[:team].actions_for_association_links = [:list]
  end
end  

The list of players now includes team for each player. If you click on the team, a nested list view opens for the team.

The strange behaviour is that the nested list draws its title from the wrong source, the id of the team. For example, given this scenario:

| Team      |   ID  |
|  Lions    |   1   |
|  Bears    |   2   |

| Player    |  ID   |   Team (ID)    |    
| Dilbert   |   1   |   Lions (1)    |
| Snarkle   |   2   |   Lions (1)    |
| Driscol   |   3   |   Bears (2)    |

Click on Lions in the line for Snarkle, player 2, and the nested list will be labeled "Team for Dilbert". Click on Bears for Driscol, and the label will be "Team for Snarkle". The name in the label is being formed from the id of the team (e.g. 1 for the Lions) when it should be using the player's id.

Besides the wrong label, the nested view will fail to open at all if there is not a player with the same id as the team being opened. In my test it doesn't crash or give an error message, nothing happens, but it's probably because of a failed lookup for the player.

I think the problem may have other affects as well, since what I'm trying to do works when a list is primary but not when it's nested, but I can't be sure about that.

How to use flash-type error messages

How does one send custom error messages like the "error 500" or "object cannot be deleted" in ActiveScaffold? I've tried using flash.now[:error] but it doesn't seem to do anything. Is there a way to tap into the very same function that currently displays the errors?

"The {{key}} interpolation syntax in I18n messages is deprecated."

I get this message during testing when the program sends the message "1 error prohibited this from being saved." I traced it to lines 100 and 101 of plugins\active_scaffold\lib\active_scaffold\locale\en.rb where {{key}} is still being used. It is also in the de.rb and fr.rb files. I would fix such an easy error myself but haven't yet learned how to check out and commit gits :-( .

Habtm nested RJS error "options is undefined" (contains fix)

vi active_scaffold/frontends/default/views/add_existing.js.rjs +2
Replace line 2

  • page << "ActiveScaffold.create_record_row('#{active_scaffold_tbody_id}','#{escape_javascript(new_row)}');"
  • page << "ActiveScaffold.create_record_row('#{active_scaffold_tbody_id}','#{escape_javascript(new_row)}', {insert_at: 'top'});"

Numeric values in fixtures cause error

I don't know whether this is a bug or I'm doing something wrong but ... it seems that if a fixture value is a number (an integer, at least), then the functional test on create and update have errors. Line 134 of attribute_params.rb appears to assume that value is a string, since it says "value.gsub....". I placed a value=value.to_s before that line, but I don't know if that's taking care of everything or just hiding a problem. Why does this work in the development environment but not in testing?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.