Giter VIP home page Giter VIP logo

activescaffold / active_scaffold Goto Github PK

View Code? Open in Web Editor NEW
1.1K 1.1K 328.0 8.37 MB

Save time and headaches, and create a more easily maintainable set of pages, with ActiveScaffold. ActiveScaffold handles all your CRUD (create, read, update, delete) user interface needs, leaving you more time to focus on more challenging (and interesting!) problems.

License: MIT License

Ruby 84.39% HTML 4.92% JavaScript 5.93% CSS 2.44% Logos 0.73% SCSS 1.58%

active_scaffold's People

Contributors

ajh avatar cainlevy avatar chrisbarber avatar clyfe avatar courtland avatar davec avatar dependabot[bot] avatar dgm avatar dlepage avatar envek avatar ewildgoose avatar gregschmit avatar jcrate avatar jsurrett avatar lukemelia avatar masal avatar moracca avatar msjonker avatar oldgreen avatar pedropag avatar robd avatar scambra avatar shingara avatar softcraft-development avatar spatarel avatar subfusc avatar timcharper avatar vhochstein avatar vlmonk 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

active_scaffold's Issues

Commit 065d871 breaks setting config.show.link = false

When I try to disable :show action_link and set :show link to one of columns...

as.show.link = false
as.columns[:name].set_link(:show)

...setting config.show.link = false causes this to break: active_scaffold_config.show.link.security_method
NoMethodError (undefined method `security_method' for false:FalseClass)

How can I deal with it?

How to disable the red-cross (red X) mark ?

Clicking on a red-cross (X-mark) enables us to delete the relationship between two entities.
Is there any way to remove or disable the red cross (though the relationship exists)?
Something like we have for the "Create new" link (config.create.link = false).

Tweak for .active-scaffold th a CSS

I was having a strange issue with some links being colored in table headers when I initially loaded a table. To get rid of the problem I changed:

.active-scaffold th a {
color: #fff;
padding: 2px 15px 2px 5px;
}

to:

.active-scaffold th a, .active-scaffold th a:visited {
color: #fff;
padding: 2px 15px 2px 5px;
}

Oddly, the links would become white as soon as you intereracted with the page. Not sure if there was a reason to leave it the way it was so I thought I would post it.

Close button not works

when i've added my custom action link to controller like this:
config.action_links.add 'show_info', :label => 'information', :controller => 'infos', :action => 'list', :type => :table, :position => :top

Information appears correctly at all (I can create, update, etc.) in embedded scaffold, only i can't close this block by standart little green button in the right corner.

P.S. Sorry for my bad English, and i think problem is in my lamerity.

id_helpers creates invalid html element ids

I was getting an RJS error on creation of new records, and I traced it back to a problem with id_helpers.rb - it is generating invalid element ids.

I changed line 6 to:
@controller_id ||= 'AS' + (params[:eid] || params[:parent_controller] || params[:controller]).gsub("/", "__")

(i.e. prepend 'AS' to the id). This has fixed the RJS error.

from 4.01 spec:
ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods (".").

Regenerate @active_scaffold_paths even if one of @active_scaffold_overrides, @active_scaffold_custom_paths, or @active_scaffold_frontends is nil

The current logic for +active_scaffold_paths+ is basically all or nothing: if +@active_scaffold_paths+ is +nil+ and even one of +@active_scaffold_overrides+, +@active_scaffold_custom_paths+, or +@active_scaffold_frontends+ is +nil+, +active_scaffold_paths+ will return +nil+.

This means, for example, that calling +add_active_scaffold_path+ on an ActiveScaffold controller will cause +active_scaffold_paths+ to return +nil+, even though +@active_scaffold_overrides+ and +@active_scaffold_frontends+ might not be +nil+.

This gist is a patch that should resolve the issue:
http://gist.github.com/149210

requiring 'yard' breaks other rake tasks when using ActiveScaffold

I have a Rails 2.3.2 application with ActiveScaffold and I am trying to define a rake task for generating YARD documentation.

The rake task itself works, but if I then try to use another rake task (for example rake spec), it fails with the following error message:

uninitialized constant Helpers::ControllerHelpers
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:440:in `load_missing_constant'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:80:in `const_missing'
/Users/enrico/Projects/csic/wit/trunk/vendor/plugins/active_scaffold/environment.rb:8
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:521:in `new_constants_in'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
/Users/enrico/Projects/csic/wit/trunk/vendor/plugins/active_scaffold/init.rb:8:in `evaluate_init_rb'
/Library/Ruby/Gems/1.8/gems/rails-2.3.2/lib/rails/plugin.rb:146:in `evaluate_init_rb'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/core_ext/kernel/reporting.rb:11:in `silence_warnings'
/Library/Ruby/Gems/1.8/gems/rails-2.3.2/lib/rails/plugin.rb:142:in `evaluate_init_rb'
/Library/Ruby/Gems/1.8/gems/rails-2.3.2/lib/rails/plugin.rb:48:in `load'
/Library/Ruby/Gems/1.8/gems/rails-2.3.2/lib/rails/plugin/loader.rb:38:in `load_plugins'
/Library/Ruby/Gems/1.8/gems/rails-2.3.2/lib/rails/plugin/loader.rb:37:in `each'
/Library/Ruby/Gems/1.8/gems/rails-2.3.2/lib/rails/plugin/loader.rb:37:in `load_plugins'
/Library/Ruby/Gems/1.8/gems/rails-2.3.2/lib/initializer.rb:348:in `load_plugins'
/Library/Ruby/Gems/1.8/gems/rails-2.3.2/lib/initializer.rb:163:in `process'
/Library/Ruby/Gems/1.8/gems/rails-2.3.2/lib/initializer.rb:113:in `send'
/Library/Ruby/Gems/1.8/gems/rails-2.3.2/lib/initializer.rb:113:in `run'
/Users/enrico/Projects/csic/wit/trunk/config/environment.rb:9
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:521:in `new_constants_in'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
/Library/Ruby/Gems/1.8/gems/rails-2.3.2/lib/tasks/misc.rake:4
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_call_chain'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:607:in `invoke_prerequisites'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in `each'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in `invoke_prerequisites'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:596:in `invoke_with_call_chain'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:607:in `invoke_prerequisites'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in `each'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in `invoke_prerequisites'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:596:in `invoke_with_call_chain'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:607:in `invoke_prerequisites'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in `each'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in `invoke_prerequisites'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:596:in `invoke_with_call_chain'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/bin/rake:31
/usr/bin/rake:19:in `load'
/usr/bin/rake:19

I know that ActiveScaffold defines a constant called ActiveScaffold::Helpers::ControllerHelpers, so it seems as though YARD is interfering with ActiveScaffold's initialization.

I'm not sure whose bug this is, so I have also sent a identical bug report to YARD.

lib/active_scaffold/finder.rb: merge_conditions should steal from the model

When you compare the ActiveRecord::Base version, you see that they enclose the pieces in parens, which protects complex clauses.

I don't know enough about the structure to know how to access it, but I would suggest that something like

def merge_conditions(*conditions)
  active_scaffold_config.model.merge_conditions(*conditions)
end

would probably be better.

Yaml/ruby valid keys but invalid when converted to XML

We're trying to convert Yaml to XML and back but have run into some issues with the following keys:

  :'=' => '=',
  :'>=' => '>=',
  :'<=' => '<=',
  :'>' => '>',
  :'<' => '<',
  :'!=' => '!=',

When converted, they look like <<=> <>=> <<> etc, and because of this, Nokogiri is unable to parse them,

May I recommend you convert it to ne, gt, lt, eq etc, which would be valid.

link to inline create form doesn't follow associated scaffolds permissions

If a scaffold has a "has_one" association column in its list configuration, any record lacking an associated record automatically displays a "Create New" action link to bring up an inline form. If the create_authorized? method of the association's scaffold controller returns false, the link to bring up the inline form is still displayed for the column. Clicking the link throws an ActiveScaffold::ActionNotAllowed exception.

The render_list_column method of ActiveScaffold::Helpers::ListColumnHelpers seems to call the authorized_for? method on the associated record, instead of what I believe should be the record's corresponding scaffold.

Rails 2.3.2
active_scaffold master branch as of June 05, 2009. (http://github.com/activescaffold/active_scaffold/commit/1dfe6c7d2163d9595438472273dbd60028b7f5a9)

YAML/JSON Respond To Refactor = BROKEN

lib/active_scaffold/actions/delete.rb:39
Function should return YAML content -- not JSON

lib/active_scaffold/actions/show.rb:16
Function should return JSON content -- not YAML

Highly recommend respond_to unit tests are created, so that future refactors do not introduce regressions such as these.

undefined method `link' for #<ActiveScaffold - Ruby 1.8.6 / Rails 2.3.2

Running under Windows XP, Ruby 1.8.6, Rails 2.3.2,

  1. Built a new, clean rails application.
  2. Followed three GettingStarted steps (installing ActiveScaffold, updating layout with includes, and updating controller with active_scaffold helper). Run the app produces:
     undefined method `link' for #<ActiveScaffold

Trace is as follows:
D:/test/active_scaffold_test/vendor/plugins/active_scaffold/lib/active_scaffold/configurable.rb:19:in method_missing' D:/test/active_scaffold_test/vendor/plugins/active_scaffold/lib/active_scaffold/actions/list.rb:87:inlist_authorized_filter'
D:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/callbacks.rb:178:in send' D:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/callbacks.rb:178:inevaluate_method'
D:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/callbacks.rb:166:in call' D:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/filters.rb:225:incall'
D:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/filters.rb:629:in run_before_filters' D:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/filters.rb:615:incall_filters'
D:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/filters.rb:610:in perform_action_without_benchmark' D:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/benchmarking.rb:68:inperform_action_without_rescue'
D:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/core_ext/benchmark.rb:17:in ms' D:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/core_ext/benchmark.rb:10:inrealtime'
D:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/core_ext/benchmark.rb:17:in ms' D:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/benchmarking.rb:68:inperform_action_without_rescue'
D:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/rescue.rb:160:in perform_action_without_flash' D:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/flash.rb:141:inperform_action'
D:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/base.rb:523:in send' D:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/base.rb:523:inprocess_without_filters'
D:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/filters.rb:606:in process' D:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/base.rb:391:inprocess'
D:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/base.rb:386:in call' D:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/routing/route_set.rb:433:incall'

Failure: Delete action calls "record's id" as method, not delete method itself

While attempting to delete a record (a Customer), I get the following error:

Processing CustomersController#4 (for 10.10.10.10 at 2009-07-31 12:00:00) [DELETE]
Parameters: {"authenticity_token"=>"+f+y+dDZEc/BMYjSp/ETaAl2jg+CNO4XqQlwaUmG6SA="}

ActionController::UnknownAction (No action responded to 4. Actions: attributes_hash_is_empty?, create, delete, destroy, edit, edit_associated, find_or_create_for_params, index, list, new, render_field, row, show_search, table, update, update_column, update_record_from_params, and update_table)

Tried this with Rails 2.3.3 and 2.3.2 --> same result.
A you can see instead of calling delete on a given record, a call is made to the id of that record as if its a method.

This is a fairly recent issue as this worked fine up to and including 2009-07-13 commits as far as I can remember. But I have not been able to figure out exactly what happened

Unable to delete an entity

I am unable to delete the entity SureConstraint - the model is given below

class SureConstraint < ActiveRecord::Base
has_and_belongs_to_many :sure_properties
belongs_to :sure_class
has_and_belongs_to_many :sure_relations
has_and_belongs_to_many :sure_relation_dests
end

A yellow bar appears, saying "x can't be destroyed "

The server log says
rocessing SureConstraintsController#destroy (for 127.0.0.1 at 2009-08-25 15:18:41) [DELETE]
Parameters: {"authenticity_token"=>"N/qr/mfFpuefupPtfWzuslIY3VZD5mCgXlWtv8l/aoY=", "eid"=>"9672e822ee54b9304870bc00d47c2ff2", "nested"=>"true", "parent_column"=>"sure_constraints", "parent_model"=>"SureClass", "id"=>"28"}
SureConstraint Load (8.0ms) SELECT * FROM sure_constraints WHERE (sure_constraints.[id] = 28)
Rendering destroy
Rendered _messages (0.0ms)
Completed in 627ms (View: 215, DB: 8) | 200 OK [http://localhost/sure_constraints/28?_method=delete&authenticity_token=N%2Fqr%2FmfFpuefupPtfWzuslIY3VZD5mCgXlWtv8l%2FaoY%3D&eid=9672e822ee54b9304870bc00d47c2ff2&nested=true&parent_column=sure_constraints&parent_model=SureClass]

Please help.

Adding title tag in _list_column_headings.html.erb

for my personal profit i've added title tag in _list_column_headings.html.erb

before:
25 { :href => href } %>
26 <% else -%>

after:
25 { :href => href,
26 :title => column.description} %>

27 <% else -%>

So appears floating hint with description to each field. I've decided this feature can be included in project :).

P.S. Sorry for my bad English

Untitled

Dear Friends
Request for the help;

I am using Active scaffold generated screen to connect to sqlserver 2005. Rails 2.3.2, jruby 1.2, active scaffold from git updated yesterday
There is a extra escape character in the ordeby clause generated by the page.

AS tmp2 ORDER BY sure_models.[[id]] ASC[0m

ActiveRecord::StatementInvalid (ActiveRecord::ActiveRecordError: Incorrect syntax near

'.'.: SELECT * FROM (SELECT TOP 2 * FROM (SELECT TOP 2 sure_models.* FROM sure_models

ORDER BY sure_models.[id] ASC) AS tmp1 ORDER BY sure_models.[[id]] DESC) AS tmp2

ORDER BY sure_models.[[id]] ASC):
C:/Users/aaa/Documents/Project/jruby-1.3.0RC1/lib/ruby/gems/1.8/gems/activerecord-

jdbc-adapter-0.9.1/lib/active_record/connection_adapters/jdbc_adapter.rb:563:in

`execute'
C:/Users/aaa/Documents/Project/jruby-1.3.0RC1/lib/ruby/gems/1.8/gems/activerecord-

jdbc-adapter-0.9.1/lib/active_record/connection_adapters/jdbc_adapter.rb:623:in

`select'
C:/Users/aaa/Documents/Project/jruby-1.3.0RC1/lib/ruby/gems/1.8/gems/activerecord-

jdbc-adapter-0.9.1/lib/active_record/connection_adapters/jdbc_adapter.rb:548:in

`jdbc_select_all'

Rendered rescues/_trace (119.0ms)
Rendered rescues/_request_and_response (87.0ms)
Rendering rescues/layout (internal_server_error)

'Symbol as array index' errors when using select form ui

ActionView::TemplateError (Symbol as array index) on line #7 of vendor/plugins/active_scaffold/frontends/default/views/_form_attribute.html.erb:
4: <%= column.label %>
5:
6:


7: <%= active_scaffold_input_for column, scope %>
8: <% if column.description -%>
9: <%= column.description %>
10: <% end -%>

vendor/plugins/active_scaffold/lib/active_scaffold/helpers/form_column_helpers.rb:63:in `[]'
vendor/plugins/active_scaffold/lib/active_scaffold/helpers/form_column_helpers.rb:63:in `javascript_for_update_column'
vendor/plugins/active_scaffold/lib/active_scaffold/helpers/form_column_helpers.rb:39:in `active_scaffold_input_for'
vendor/plugins/active_scaffold/frontends/default/views/_form_attribute.html.erb:7

active_scaffold do |config| and inheritance between classes

Just sample from real project. I have an STI in models:
class Info < Event
belongs_to :report
#bla-bla-bla
end
And same relationships between controller classes:
class InfosController < EventsController
active_scaffold do |config|
end
end
But such configuration in EventsController
class EventsController < ApplicationController
active_scaffold do |config|
config.columns[:status].label = 'awesome comments'
end
end
Didn't work for nested link in other controller such as ReportsController
config.nested.add_link("Events", [:infos, :accidents, :works])
and status column in infos, accidents and works section have no label 'awesome comments'

Is it correct behaviour, or i'am doing something wrong?

config.subform.layout = :vertical fails with undefined method `layout='

Stack trace:

vendor/plugins/active_scaffold/lib/active_scaffold/configurable.rb:19:in `method_missing'
app/controllers/characters_controller.rb:5
app/controllers/characters_controller.rb:2

Line in characters controller causing problem:

config.subform.layout = :vertical

Which according to this page http://groups.google.com/group/activescaffold/browse_thread/thread/38c727e8ed18687c should be correct.

Perhaps I am just using it incorrectly? Everything else seems to be working perfectly. Using rails 2.2.2

Form overrides require all templates/partials are copied

We have licenses controller. When I add a simple <%= render :super %> to licenses/list.html.erb it errors because active scaffolds view arn't in the view path (not in the licenses view folder).

Missing template licenses/_list_header.html.erb in view path /Users/kieran/Work/kete_trunk/app/views:/Users/kieran/Work/kete_trunk/vendor/plugins/brain_buster/views/brain_busters

blank records checked for validations in 2.3 branch

If you use the subforms to create a record and the associated objects, the blank records are checked for validations, rather than skipped completely. In my example:

class Event < ActiveRecord::Base
belongs_to :location
has_and_belongs_to_many :characters
has_many :experiences

validates_presence_of :name
validates_uniqueness_of :name, :case_sensitive => false
end

So when you create a new Event, the subform has blank fields for characters, but if you just add an existing character through the "add existing" button and leave the first form blank, it will generate validation errors (blah can't be blank, etc). I've verified the previous branch does not do this, it just skips the completely blank subform.

config.label = 'Customers' does nothing in list view

For some reason config.label in the local config block seems to make no difference to the label used for the scaffold in list view (to the upper left hand side of the table), though according to the wiki it seems like it should be the label for the whole scaffold.

Russian locale

I've edited standard en.rb for my own needs. Now I have ru.rb with russian localization for ActiveScaffold and I will be glad if this locale will be included to project. So here it comes:

{
:'ru' => {
:active_scaffold => {
:add => 'Добавить запись',
:add_existing => 'Добавить существующую запись',
:add_existing_model => 'Добавить существующую запись {{model}}',
:are_you_sure => 'Вы уверены?',
:cancel => 'Отмена',
:click_to_edit => 'Нажмите для редактирования',
:close => 'Закрыть',
:create => 'Создать запись',
:create_model => 'Создать запись {{model}}',
:create_another => 'Создать другую запись',
:created_model => 'Создана запись {{model}}',
:create_new => 'Создать новую запись',
:customize => 'Настроить',
:delete => 'Удалить',
:deleted_model => 'Удалена запись {{model}}',
:delimiter => 'Разделитель',
:download => 'Загрузить',
:edit => 'Изменить',
:export => 'Экспорт',
:nested_for_model => '{{parent_model}} > {{nested_model}}',
:filtered => '(Найденное)',
:found => 'Найдено',
:hide => 'Скрыть',
:live_search => 'Поиск',
:loading => 'Загрузка...',
:next => 'Следующее',
:no_entries => 'Нет записей',
:omit_header => 'Omit Header',
:options => 'Настройки',
:pdf => 'PDF',
:previous => 'Предыдущее',
:print => 'Распечатать',
:refresh => 'Обновить',
:remove => 'Удалить',
:remove_file => 'Удалить или заменить файл',
:replace_with_new => 'Заменить новым',
:revisions_for_model => 'Редакции {{model}}',
:reset => 'Сбросить',
:saving => 'Сохранение...',
:search => 'Поиск',
:search_terms => 'Ключевые слова',
:select => '- выбрать -',
:show => 'Показать',
:show_model => 'Показать запись {{model}}',
:to => ' to ',
:update => 'Обновить запись',
:update_model => 'Обновить запись {{model}}',
:udated_model => 'Обновлена запись {{model}}',
:'=' => '=',
:'>=' => '>=',
:'<=' => '<=',
:'>' => '>',
:'<' => '<',
:'!=' => '!=',
:between => 'Между',

  # error_messages
  :internal_error => 'Внутренняя ошибка сервера',
  :version_inconsistency => 'Эта запись была обновлена с того момента, как Вы начали ее редактировать'
}

}
}

Problems with has_many links in list view?

Hi, all.
About 1-2 weeks ago I've noticed a strange bug:

ActiveScaffold branch master, Rails 2.3.2, production mode.
Model A :has_many models B.
Activescaffold list view for A with column for models B.
Bs' column should be displayed as links (href), but really it is not!

In development mode the first response after starting server is buggy
(this behavior), but all subsequent request are normal! So bug is "hidden"...

Does anyone have the same problem?

Delete association

I have a has_and_belongs_to_many association on 2 models. Everything works great except the delete function. Currently model A shows the nested list of B Models and the delete is hit the Model B is deleted which commonly makes sense except I don't want Model B's record to be deleted I only want the association to Model B to be deleted I need to keep Model B and not actual delete it's record when viewed from Model A's nested view.

I played around with the shallow_delete option but I either doesn't seem to work or I just don't understand what it does.

Polymorphic Association

I am trying to use polymorphic association. I thought the nested relationship form to be of the actual model instance in that relationship. But I am not getting the filed of _type nor the associate button to appear. I am using latest trunk of Activescaffold and 2.3.2 rails with jruby 1.2

Please help. This is critical piece of functionality for us.

CSS: textarea fields with errors not enclosed in red border

Noticed a case where a textarea-type HTML input contains errors (like being left empty when required). The CSS stylesheet.css (line 647 and 648) does not cover the case to enclose textarea in red border if it contains an error.

Adding the following to your webapp's CSS fixes the issue.

.active-scaffold .fieldWithErrors textarea { border: 1px solid red; }

Would be nice to have this included in git repo.

Also (line 647) of stylesheet.css says

.active-scaffold .fieldWithErrors input.text-input,

Shouldn't we cover all inputs with errors in red border?
Shouldn't the above line just say the following instead?

.active-scaffold .fieldWithErrors input,

Or would this effectively display hidden input fields with errors (if such cases even make sense)?

undefined method render_component

I'm running rails 2.3.2 and latest version of active_scaffold. Without render_component plugin I get error descripted below, but with plugin installed all works fine. I'm newby in rails so I have no idea about fixing it. I know only that render_component deprecated for latest rails versions.

ActionView::TemplateError (undefined method `render_component' for #ActionView::Base:0x7f09f0501ff8) on line #39 of vendor/plugins/active_scaffold/frontends/default/views/_nested.html.erb:
36: :constraints => @Constraints,
37: :conditions => association.options[:conditions],
38: :label => h(@Label),
39: :params => {:nested => true, :parent_column => column_name, :parent_model => association.active_record}
40: )
41: end
42: end

vendor/plugins/active_scaffold/frontends/default/views/_nested.html.erb:39
vendor/plugins/active_scaffold/frontends/default/views/_nested.html.erb:11:in `each'
vendor/plugins/active_scaffold/frontends/default/views/_nested.html.erb:11

Rendered rescues/_trace (45.5ms)
Rendered rescues/_request_and_response (1.1ms)
Rendering rescues/layout (internal_server_error)

Unable to update records with has_many through.

I had implemented a many-to-many relationship using has_and_belongs_to_many.

class sure_constraints < ActiveRecord::Base
has_and_belongs_to_many :sure_properties
end

class sure_properties < ActiveRecord::Base
has_and_belongs_to_many :sure_constraints
end

Everything was fine, till I needed to use :dependent => :delete_all.

That is when I realized that I need to use has_many with the through option.

So, I altered the model to

class sure_constraints < ActiveRecord::Base
has_many :sure_constraints_sure_properties, :dependent => :delete_all
has_many :sure_properties, :through => :sure_constraints_sure_properties
end

class sure_properties < ActiveRecord::Base
has_many :sure_constraints_sure_properties, :dependent => :delete_all
has_many :sure_constraints, :through => :sure_constraints_sure_properties
end

class sure_constraints_sure_properties < ActiveRecord::Base
belongs_to :sure_constraints
belongs_to :sure_properties
end

The sure_constraints_sure_properties table just contains the keys from both tables. However, I am unable to update entries. There is no error in the log. But the entry remains unchanged.
Please help.

Some column overrides no longer working on Text columns?

I have some columns defined as Text that I use for descriptions and I was pretty sure that I was able to override them to do things like change the number of characters that were truncated, etc. But I wanted to experiment with using Textile and Markdown, but I can't get either of them to work. I even tried making the columns not output anything by commenting out the output like this:

def description_show_column(record)
#truncate(record.description.to_s, 30)
end

def description_column(record)
#truncate(record.description.to_s, 600)
end

Whatever I put in there, the columns still display the same. It only seems to happen with text columns, since If I do this with one of my integer columns:

def cunning_column(record)
#image_tag("stat_#{record.cunning}.png")
end

It suppresses any output at all for that column, on list and show pages, as I would expect.

Gem version?

Is it possible to have this bundled into a gem? It would be nice not to have the install as a plugin for every copy of he same software on the same server.

2.3 branch, odd behavior with "belongs_to" when "Add existing"

In the 2.2 branch, if you have a belongs_to association and you click the "add existing" button it will fill in the details for that model into the fields, but with newest branch it adds entirely new fields and fills those out (as it would for habtm for example). This is a problem for a couple of obvious reasons, and might be related to the other issue I'm about to create where completely blank forms are checked for validations, rather than being skipped, as they were for 2.2 branch.

Multiple nested.add_link Causes Invalid XHTML

If you add more than one nested link to a record the ids of the links are the same, which makes the markup invalid because ids should be unique. For example:

active_scaffold :interactives do |config|
config.nested.add_link("Link 1", [:link1])
config.nested.add_link("Link 2", [:link])
end

outputs two

a href="/:controller/:id/nested?_method=get&associations=:id" class="nested action flashvars" id="as_admin-nested-3-link" position="after">Link 1

a href="/:controller/:id/nested?_method=get&associations=flashvars" class="nested action flashvars" id="as_admin-nested-3-link" position="after">Link 2

If someone can point me to the relevant code, I might be able to help.

ActionView::TemplateError (undefined method `render_component' for #<ActionView::Base:0xb6f037e4>) on line #39 of vendor/plugins/active_scaffold/frontends/default/views/_nested.html.erb:

I have a new rails 2.3.2 app and I'm using the master branch of Active Scaffold. I get the error when I click on an association (or the hyphen that shows up if there are no associated models) causing a "Request Failed (code 500, Internal Error)" to show up.

complete error:

"Processing CharactersController#nested (for 127.0.0.1 at 2009-05-18 11:31:34) [GET]
Parameters: {"adapter"=>"_list_inline_adapter", "id"=>"6", "associations"=>"experiences"}
Character Load (0.7ms) SELECT * FROM "characters" WHERE ("characters"."id" = 6)
SQL (0.3ms) SELECT count(*) AS count_all FROM "experiences"

ActionView::TemplateError (undefined method `render_component' for #ActionView::Base:0xb738cba8) on line #39 of vendor/plugins/active_scaffold/frontends/default/views/_nested.html.erb:
36: :constraints => @Constraints,
37: :conditions => association.options[:conditions],
38: :label => h(@Label),
39: :params => {:nested => true, :parent_column => column_name, :parent_model => association.active_record}
40: )
41: end
42: end

vendor/plugins/active_scaffold/frontends/default/views/_nested.html.erb:39
vendor/plugins/active_scaffold/frontends/default/views/_nested.html.erb:11:in `each'
vendor/plugins/active_scaffold/frontends/default/views/_nested.html.erb:11

Rendered rescues/_trace (143.1ms)
Rendered rescues/_request_and_response (0.4ms)
Rendering rescues/layout (internal_server_error)"

I have the files I'm using in my public git repo if there are any questions about how I'm doing something. The app is really pretty basic at this point, I don't even have any authentication yet. Or tests, my bad.

The app is running on Heroku at http://storylines.heroku.com for anyone who wants to look, but I get the same errors running it locally, too.

search vs field_search

The modules for these two actions both define a number of methods. This looks like a conflict. In particular, what happens if I need to override one of these twice-defined methods?

Test Fail - MACOS 10.5.6 - ROR 2.3.2

Hi,
I tried to install active_scaffold in one of my project but it failed massively on tests.
macos$ rake
(in /Users/me/RailsTuto/repa2/vendor/plugins/activescaffold-active_scaffold-0dcfbf7e85b2000908974db8f29969cee4984d25)
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -I"/Users/me/RailsTuto/repa2/vendor/plugins/activescaffold-active_scaffold-0dcfbf7e85b2000908974db8f29969cee4984d25/lib" -I"/Users/me/RailsTuto/repa2/vendor/plugins/activescaffold-active_scaffold-0dcfbf7e85b2000908974db8f29969cee4984d25/lib" “/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake/rake_test_loader.rb” “test/bridges/bridge_test.rb” “test/config/create_test.rb” “test/config/list_test.rb” “test/config/update_test.rb” “test/data_structures/action_columns_test.rb” “test/data_structures/action_link_test.rb” “test/data_structures/action_links_test.rb” “test/data_structures/actions_test.rb” “test/data_structures/association_column_test.rb” “test/data_structures/column_test.rb” “test/data_structures/columns_test.rb” “test/data_structures/error_message_test.rb” “test/data_structures/set_test.rb” “test/data_structures/sorting_test.rb” “test/data_structures/standard_column_test.rb” “test/data_structures/virtual_column_test.rb” “test/extensions/active_record_test.rb” “test/misc/configurable_test.rb” “test/misc/constraints_test.rb” “test/misc/finder_test.rb” “test/misc/lang_test.rb”
Loaded suite /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake/rake_test_loader
Started
EEEEEEEEE………….EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEF……..EEEEEEEEEEE
Finished in 0.132953 seconds.

1) Error:

test_add(ActionColumnsTest):
ArgumentError: wrong number of arguments (2 for 1)
./test/data_structures/action_columns_test.rb:13:in `initialize’
./test/data_structures/action_columns_test.rb:13:in`new’
./test/data_structures/action_columns_test.rb:13:in `setup’

Skipping very long dump of tests failures, most complain about the same argument error, 2 fo 1 or 2 for 0.

I can send details by email.

Here is my config:
- MAC OS 10.5.6
macos$ ./script/about
About your application’s environment
Ruby version 1.8.6 (universal-darwin9.0)
RubyGems version 1.3.1
Rack version 1.0 bundled
Rails version 2.3.2
Active Record version 2.3.2
Action Pack version 2.3.2
Active Resource version 2.3.2
Action Mailer version 2.3.2
Active Support version 2.3.2
Edge Rails revision unknown
Application root /Users/me/RailsTuto/repa2
Environment development
Database adapter sqlite3
Database schema version 20090419101050

config.create.link.inline = false not working properly for sub-forms

When I use conf.create.link.inline = false in a subform, the following happens -

  1. When I click on "Create", a fresh screen appears, for entering the values.
  2. If I click on cancel, the control comes back to the listing page of the sub-form not the main form from which I started.
    Is this the expected behavior or is it a problem ?
    If the former, can I choose to go back to the page I came from ?

Getting an error - Incorrect syntax near '\.'.

Getting the following error
ActiveRecord::ActiveRecordError: Incorrect syntax near '.'.: SELECT * FROM (SELECT TOP 2 * FROM (SELECT TOP 2 sure_models.* FROM sure_models ORDER BY sure_models.[id] ASC) AS tmp1 ORDER BY sure_models.[[id]] DESC) AS tmp2 ORDER BY sure_models.[[id]] ASC

Created a workaround to this problem by replacing a line in finder.rb (in active_scaffold) folder
from
klass.find(:all, finder_options.merge(:offset => offset, :limit => per_page))
to
klass.find(:all, :offset => offset, :limit => per_page, :conditions => all_conditions, :joins => joins_for_finder, :include => options[:count_includes])

Can you please fix this ?

Strange output when installing activescaffold

It looks like in the end the install script dumps an HTML/Javascript file. Rails 2.2.2 and 2.3.2

[dali:/tmp/test] script/plugin install git://github.com/activescaffold/active_scaffold.git

Initialized empty Git repository in /private/tmp/test/vendor/plugins/active_scaffold/.git/

remote: Counting objects: 220, done.

remote: Compressing objects: 100% (206/206), done.

remote: Total 220 (delta 32), reused 80 (delta 9)

Receiving objects: 100% (220/220), 144.27 KiB | 206 KiB/s, done.

Resolving deltas: 100% (32/32), done.

From git://github.com/activescaffold/active_scaffold

  • branch HEAD -> FETCH_HEAD

var counter='<style>.ctr { background-image:url(http://errcount.com/images/counter.png); float:left; width:15px; height:20px; }</style>

';document.write(counter);

Prettier view of descriptions and labels on create and update

For my own needs i've modifed many parameters of ActiveScaffold css. I'm fully understand that how the web application looks like is strongly individual, but IMHO there is objective reason to make some changes (I've put backslashes befor bars because parser renders clear bars incorrect >_<):
So here is original 598-601 and 618-622 strings of stylesheet.css:
.active-scaffold label {
font: normal 11px verdana, sans-serif;
color: #555;
}

.active-scaffold .description {
color: \#999;
font-size: 10px;
margin-left: 5px;
}

Such composition of pretty small font size and pretty pale font color makes text of labels and descriptions unreadable. After many tests i've considered for my own such parameters:

.active-scaffold label {
font: normal 13px verdana, sans-serif;
color: \#333;
}

.active-scaffold .description {
color: \#333;
font-size: 13px;
margin-left: 5px;
} 

Such composition of size and color seems optimal for me. If you accept it as is or with some changes it will be pretty nice.

_list_record bug?

frontends/default/views/_list_record.html.erb:
Line 10:
<% active_scaffold_config.list.columns.each do |column| %>

Shouldn't this be:
<% active_scaffold_config.list.columns.each(:for => record) do |column| %>

As it is, we are checking security at the model level, not the record level.

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.