Re: AS for Rails 2.3?
El Tuesday 24 February 2009 04:19:49 Wes Gamble escribió: Is the latest v. of AS in github good for Rails 2.3? I should have been following more closely, sorry. If there isn't a version that's good for 2.3, which one is good for 2.2? Thanks, Wes Gamble Master branch works with rails 2.3, rails-2.2 branch only with rails 2.2 You need render_component plugin to use embedded and nested scaffolds in rails 2.3 -- Sergio Cambra .:: entreCables S.L. ::. Nicolás Guillén 6, locales 2 y 3. 50.018 Zaragoza T) 902 021 404 F) 976 52 98 07 E) ser...@entrecables.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups ActiveScaffold : Ruby on Rails plugin group. To post to this group, send email to activescaffold@googlegroups.com To unsubscribe from this group, send email to activescaffold+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/activescaffold?hl=en -~--~~~~--~~--~--~---
Re: Strange translation missing: en error after upgrading to Rails 2.2
El Tuesday 24 February 2009 08:30:14 Wes Gamble escribió: cntrytwist wrote: If you find a string that does not get caught by the missing translation error, simply enclose the string inside as_() Example %= link_to 'Done' ... Change to %= link_to as_('done') ... Add the following to en.yml done: Done I'm confused about how to properly use this: I have this in my controller: active_scaffold :servers do |config| config.list.label = 'servers' and this in my en.yml file: en: active_scaffold: servers: Servers That works fine. If I try to use the as_('servers') syntax, as in: active_scaffold :servers do |config| config.list.label = as_('servers') then I get the translation error translation missing: en, active_scaffold, Servers When should as_() be used? In general, what does as_() do? I've always wondered. You only should use as_ in requests (views, helpers or methods of controlller), all translation methods as I18n.translate from rails i18n or _() from gettext should be used only in requests. So you mustn't use as_ when you are defining a class, as when you configure active_scaffold. Also, is there any concept in Rails = 2.2 of not using locale files for a given default locale (like en). That way, we would only have to provide locale translations for the non-default locale? Reading rails i18n guide I don't think so. rails i18n use symbols for translation (instead of use english strings like gettext) and you must define the string for all languages. http://rails-i18n.org/wiki/pages/i18n-rails-guide -- Sergio Cambra .:: entreCables S.L. ::. Nicolás Guillén 6, locales 2 y 3. 50.018 Zaragoza T) 902 021 404 F) 976 52 98 07 E) ser...@entrecables.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups ActiveScaffold : Ruby on Rails plugin group. To post to this group, send email to activescaffold@googlegroups.com To unsubscribe from this group, send email to activescaffold+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/activescaffold?hl=en -~--~~~~--~~--~--~---
Re: Strange translation missing: en error after upgrading to Rails 2.2
El Tuesday 24 February 2009 08:30:14 Wes Gamble escribió: In general, what does as_() do? I've always wondered. I forgot another note. as_ method is only a call to translate method with :active_scaffold scope. -- Sergio Cambra .:: entreCables S.L. ::. Nicolás Guillén 6, locales 2 y 3. 50.018 Zaragoza T) 902 021 404 F) 976 52 98 07 E) ser...@entrecables.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups ActiveScaffold : Ruby on Rails plugin group. To post to this group, send email to activescaffold@googlegroups.com To unsubscribe from this group, send email to activescaffold+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/activescaffold?hl=en -~--~~~~--~~--~--~---
unwanted translations
I use always translation in my webs, because they are for spanish people. Currently labels method try to translate all, symbols and strings. I think it's good for translated apps, but I'm not sure for only-english apps. I have thought 3 options: 1. Change it to translate only symbols and leave strings as they are. 2. Add a global option to disable translation in as_ method 3. Leave it like now. I would like to know what people think about this. -- Sergio Cambra .:: entreCables S.L. ::. Nicolás Guillén 6, locales 2 y 3. 50.018 Zaragoza T) 902 021 404 F) 976 52 98 07 E) ser...@entrecables.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups ActiveScaffold : Ruby on Rails plugin group. To post to this group, send email to activescaffold@googlegroups.com To unsubscribe from this group, send email to activescaffold+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/activescaffold?hl=en -~--~~~~--~~--~--~---
Re: How to create a child record when the parent is not created yet?
Hello Mike, Sorry for the delay: I had to pull my last hair on this problem ;-) I have tried to recreate a simpler case and here it is. Say a company wants to keep track of invoices they issue in a DB. Each invoice will include a list of the products sold. == Here is the DB schema: ActiveRecord::Schema.define(:version = 20090213144943) do create_table invoices, :force = true do |t| t.string customer t.string invoice_ref t.datetime created_at t.datetime updated_at end create_table products, :force = true do |t| t.string reference t.integer invoice_id t.string description t.datetime created_at t.datetime updated_at end end The two models: class Invoice ActiveRecord::Base has_many :products end class Product ActiveRecord::Base belongs_to :invoice end === My controllers class InvoiceController ApplicationController def index @invoices = Invoice.find :all end def new @invoice = Invoice.new(params[:invoice]) if request.post? case params[:commit] when 'Create' @invoice.save when 'Cancel' redirect_to :action = 'index' end end end end class ProductController ApplicationController protect_from_forgery :only = [:create, :update, :delete] active_scaffold :product end === And the invoice/new view !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01//EN http://www.w3.org/TR/ html4/strict.dtd html head meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 / titleCreate New Invoice/title /head body % form_for :invoice do |f| % pInvoice Nr.br / %= f.text_field :invoice_ref %/p pCustomer Namebr / %= f.text_field :customer %/p %= render :active_scaffold = 'product', :label = 'Products', :constraints = { :invoice_id = @invoice.id } -% p%= submit_tag 'Create' %%= submit_tag 'Cancel' %/p % end % /body /html I think this gives the full picture but let me know if you need more details. Basically, when I create a new invoice and add products to it at the same time, the products don't receive any invoice_id and become orphans in my DB. Consequently, that invoice has no product list. So if before_create_save is the solution, could you explain how I should implement it? Thanks in advance for your help. Christian. On Feb 17, 3:26 pm, Mike Gaffney mr.ga...@gmail.com wrote: Christian, You deleted the context of your problem so I'm not sure. Could you put the base problem in again? -Mike --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups ActiveScaffold : Ruby on Rails plugin group. To post to this group, send email to activescaffold@googlegroups.com To unsubscribe from this group, send email to activescaffold+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/activescaffold?hl=en -~--~~~~--~~--~--~---
Re: InvalidAuthenticityToken errors when calling edit_associated on any AS controller
I had the same thing this morning with a new project I had just created. I had to add the following line to my child controller: protect_from_forgery :only = [:create, :update, :delete] In your case, I think it will have to be put in the controller associated to the sub-form. This is only a workaround, though. There is probably a cleaner way to do it. Christian. On Feb 24, 7:54 am, Wes Gamble we...@att.net wrote: All, Rails 2.3 AS - latest from github as of 02/24 00:22 CST. I have two models which are in a has_many/belongs_to relationship. If I try to create/edit either of these models and then attempt to create/update the associated model through the default subform, I get the ActionController::InvalidAuthenticityToken in XYZController#edit_associated error on the AJAX call to do the update. Here's one of the stack traces - not sure how useful it will be: ActionController::InvalidAuthenticityToken (ActionController::InvalidAuthenticityToken): actionpack (2.3.0) lib/action_controller/request_forgery_protection.rb:79:in `verify_authenticity_token' activesupport (2.3.0) lib/active_support/callbacks.rb:178:in `evaluate_method' activesupport (2.3.0) lib/active_support/callbacks.rb:166:in `call' actionpack (2.3.0) lib/action_controller/filters.rb:225:in `call' actionpack (2.3.0) lib/action_controller/filters.rb:629:in `run_before_filters' actionpack (2.3.0) lib/action_controller/filters.rb:615:in `call_filters' actionpack (2.3.0) lib/action_controller/filters.rb:610:in `perform_action_with_filters' actionpack (2.3.0) lib/action_controller/benchmarking.rb:68:in `perform_action_with_benchmark' actionpack (2.3.0) lib/action_controller/benchmarking.rb:68:in `perform_action_with_benchmark' actionpack (2.3.0) lib/action_controller/rescue.rb:154:in `perform_action_with_rescue' actionpack (2.3.0) lib/action_controller/flash.rb:141:in `perform_action_with_flash' actionpack (2.3.0) lib/action_controller/base.rb:523:in `process' actionpack (2.3.0) lib/action_controller/filters.rb:606:in `process_with_filters' actionpack (2.3.0) lib/action_controller/base.rb:391:in `process' actionpack (2.3.0) lib/action_controller/base.rb:386:in `call' actionpack (2.3.0) lib/action_controller/routing/route_set.rb:433:in `call' actionpack (2.3.0) lib/action_controller/dispatcher.rb:65:in `dispatch' actionpack (2.3.0) lib/action_controller/dispatcher.rb:88:in `_call' actionpack (2.3.0) lib/action_controller/dispatcher.rb:59:in `initialize' activerecord (2.3.0) lib/active_record/query_cache.rb:29:in `call' activerecord (2.3.0) lib/active_record/query_cache.rb:29:in `call' activerecord (2.3.0) lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache' activerecord (2.3.0) lib/active_record/query_cache.rb:9:in `cache' activerecord (2.3.0) lib/active_record/query_cache.rb:28:in `call' actionpack (2.3.0) lib/action_controller/params_parser.rb:15:in `call' actionpack (2.3.0) lib/action_controller/rewindable_input.rb:25:in `call' actionpack (2.3.0) lib/action_controller/session/cookie_store.rb:93:in `call' actionpack (2.3.0) lib/action_controller/failsafe.rb:11:in `call' actionpack (2.3.0) lib/action_controller/rack_ext/lock.rb:15:in `call' actionpack (2.3.0) lib/action_controller/dispatcher.rb:83:in `call' rails (2.3.0) lib/rails/rack/static.rb:27:in `call' rails (2.3.0) lib/rails/rack/log_tailer.rb:17:in `call' :1:in `initialize' Any thoughts? Thanks, Wes --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups ActiveScaffold : Ruby on Rails plugin group. To post to this group, send email to activescaffold@googlegroups.com To unsubscribe from this group, send email to activescaffold+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/activescaffold?hl=en -~--~~~~--~~--~--~---
Re: Installing not working
I was having this same problem. What I ended up doing to fix it was what Sergio suggested by making sure I had the correct version of active_scaffold. I went and manually downloaded the rails-2.2 build from http://github.com/activescaffold/active_scaffold/tree/master since the master build was 2.3. For some reason even though I was specifying -r rails-2.2 it was not downloading that version. There may be a way to get it to work through that method but the quick fix for me was to just do it manually. On Feb 23, 8:53 am, Sergio Cambra .:: entreCables - Symbol Servicios Informáticos S.L. ::. ser...@entrecables.com wrote: El Monday 23 February 2009 14:52:39 njs escribió: I think I am using 2.2 branch. Isn't the flag -r rails-2.2 meant to get 2.2 branch? Yes, but I was answering to other mail, and your error trace is different to that trace Are you sure you are using rails 2.2.2? You get an error about find_template doesn't exist in ActionView::PathSet, but that method exist in ActionView::PathSet in rails 2.2, but it doesn't in rails 2.3 BTW sorry for the multiple posts earlier . My browser on xubuntu was not cooperating. On Feb 23, 5:16 am, Sergio Cambra .:: entreCables - Symbol Servicios Informáticos S.L. ::. ser...@entrecables.com wrote: El Saturday 21 February 2009 16:36:15 RustyHack escribió: I downloaded the plugin and dropped it into my vendor folder. When I start up my app, I get the following message. If anyone has can offer some help here, I would appreciate it. I think you are using activescaffold master branch, you should use rails-2.2 branch. Aaron = /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/ active_support/core_ext/module/aliasing.rb:33:in `alias_method': undefined method `find_template' for class `ActionView::PathSet' (NameError) from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/ active_support/core_ext/module/aliasing.rb:33:in `alias_method_chain' from /Users/rustyhack/Desktop/blackdog/vendor/plugins/ activescaffold- active_scaffold-7b07852464780a8a8894c39d14492992cd15e972/lib/ extensions/generic_view_paths.rb:17 from /usr/local/lib/ruby/site_ruby/1.8/rubygems/ custom_require.rb:31:in `require' from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/ active_support/dependencies.rb:153:in `require' from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/ active_support/dependencies.rb:521:in `new_constants_in' from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/ active_support/dependencies.rb:153:in `require' from /Users/rustyhack/Desktop/blackdog/vendor/plugins/ activescaffold- active_scaffold-7b07852464780a8a8894c39d14492992cd15e972/ environment.rb:4 from /Users/rustyhack/Desktop/blackdog/vendor/plugins/ activescaffold- active_scaffold-7b07852464780a8a8894c39d14492992cd15e972/ environment.rb:4 ... 23 levels... from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/ active_support/dependencies.rb:153:in `require' from /usr/local/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/ commands/server.rb:49 from /usr/local/lib/ruby/site_ruby/1.8/rubygems/ custom_require.rb:31:in `require' from script/server:3 -- Sergio Cambra .:: entreCables S.L. ::. Nicolás Guillén 6, locales 2 y 3. 50.018 Zaragoza T) 902 021 404 F) 976 52 98 07 E) ser...@entrecables.com -- Sergio Cambra .:: entreCables S.L. ::. Nicolás Guillén 6, locales 2 y 3. 50.018 Zaragoza T) 902 021 404 F) 976 52 98 07 E) ser...@entrecables.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups ActiveScaffold : Ruby on Rails plugin group. To post to this group, send email to activescaffold@googlegroups.com To unsubscribe from this group, send email to activescaffold+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/activescaffold?hl=en -~--~~~~--~~--~--~---
Re: View Paths Fix / Update
I have the same problem with AS 2.2 on Rails 2.2.2 but I haven't this code in 'generic_view_paths.rb': active_scaffold_paths.find_template_without_active_scaffold (original_template_path.split('/',2).last, format) My application have admin section with this routes.rb: map.namespace :admin do |admin| admin.resources :users, :active_scaffold = true admin.resources :roles, :active_scaffold = true end List and show views are ok, but edit and new not works. Error in development.log: ActionView::TemplateError (undefined method `find_template' for #ActionView::PathSet:0xb6a56598) on line #14 of vendor/plugins/ active_scaffold/frontends/default/views/_form.rhtml: 11: /li 12: % else -% 13: li class=form-element %= 'required' if column.required? % 14: %= render :partial = form_partial_for_column (column), :locals = { :column = column } -% 15: /li 16: % end -% 17: % end -% Could you help me? Thanks! On Feb 20, 7:23 pm, Tys von Gaza t...@tvg.ca wrote: Fixed this by changing line 11 in generic_view_paths.rb: active_scaffold_paths.find_template_without_active_scaffold (original_template_path.split('/',2).last, format) to active_scaffold_paths.find_template_without_active_scaffold (original_template_path.split('/').last, format) Not sure what consequences this will have, but it seems to be working so far. Tys --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups ActiveScaffold : Ruby on Rails plugin group. To post to this group, send email to activescaffold@googlegroups.com To unsubscribe from this group, send email to activescaffold+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/activescaffold?hl=en -~--~~~~--~~--~--~---
Re: View Paths Fix / Update
I have the same problem with AS 2.2 on Rails 2.2.2: ActionView::TemplateError (undefined method `find_template' for #ActionView::PathSet:0xb674dc84) on line #14 of vendor/plugins/ active_scaffold/frontends/default/views/_form.rhtml: but I haven't this code in 'generic_view_paths': active_scaffold_paths.find_template_without_active_scaffold (original_template_path.split('/',2).last, format) My application have a admin section developed with active scaffold: This section have two controller: user and role. So in routes.rb: map.namespace :admin do |admin| admin.resources :users, :active_scaffold = true admin.resources :roles, :active_scaffold = true end List and show views are ok but new and edit generate error: 'Request Failed (code 500, Internal Error)' Could you help me? Thanks! Fixed this by changing line 11 in generic_view_paths.rb: active_scaffold_paths.find_template_without_active_scaffold (original_template_path.split('/',2).last, format) to active_scaffold_paths.find_template_without_active_scaffold (original_template_path.split('/').last, format) Not sure what consequences this will have, but it seems to be working so far. Tys --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups ActiveScaffold : Ruby on Rails plugin group. To post to this group, send email to activescaffold@googlegroups.com To unsubscribe from this group, send email to activescaffold+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/activescaffold?hl=en -~--~~~~--~~--~--~---
Re: Installing not working
El Tuesday 24 February 2009 14:24:41 escribió: Sergio, I did some more research on Rails 2.2.2. I have installed rails with gem install rails command. As per rubyforge the gem was created on Nov. 21, 2008. But as per github logs of Rails 2.2-stable branch the find_template method was introduced (I think) after that date. I see there are constant checkins going into rails 2.2-stable branch. Should I be installing rails from github rather than gem? Please advise. I install the gem from github, and I have that method. Try to add github to gem sources and reinstall the gems: rails, actionpack and so on gem sources -a http://gems.github.com/ gem install rails activerecord activeresource activesupport actionmailer actionpack Navjeet http://chabbewal.blogspot.com On Tue, Feb 24, 2009 at 8:07 AM, Navjeet navje...@gmail.com wrote: Sergio, I deleted the active_scaffold folder under vendor plugins and got it again from github. I noticed you made an update to init.rb so if one is not Rails 2.2.x an exception is raised. I do not see any such exception so I guess I am using Rails 2.2.2. Is there anyway to verify that Rails 2.2.2 has find_template method implemented? I looked at paths.rb under vendor/rails/actionpack/lib/action_view/ and it does not have find_template method. Thanks. Navjeet http://chabbewal.blogspot.com On Tue, Feb 24, 2009 at 7:42 AM, Navjeet navje...@gmail.com wrote: Sergio, I have been doing that all along. I installed active_scaffold using the command script/plugin install git:// github.com/activescaffold/active_scaffold.git -r rails-2.2 Do I need to issue another command? Navjeet http://chabbewal.blogspot.com On Tue, Feb 24, 2009 at 4:14 AM, Sergio Cambra .:: entreCables - Symbol Servicios Informáticos S.L. ::. ser...@entrecables.com wrote: El Tuesday 24 February 2009 06:39:52 escribió: I am pretty sure I am using rails 2.2.2. Running the command rails - v returns 2.2.2. Just to be sure I froze the gems for my app, and it did say it is freezing to rails 2.2.2 You are right, the line when you get the error is in master branch of active_scaffold. Remove your active_scaffold and try to install again with -r rails-2.2 I don't know why you got master branch instead of rails-2.2 On Feb 23, 10:53 am, Sergio Cambra .:: entreCables - Symbol Servicios Informáticos S.L. ::. ser...@entrecables.com wrote: El Monday 23 February 2009 14:52:39 njs escribió: I think I am using 2.2 branch. Isn't the flag -r rails-2.2 meant to get 2.2 branch? Yes, but I was answering to other mail, and your error trace is different to that trace Are you sure you are using rails 2.2.2? You get an error about find_template doesn't exist in ActionView::PathSet, but that method exist in ActionView::PathSet in rails 2.2, but it doesn't in rails 2.3 BTW sorry for the multiple posts earlier . My browser on xubuntu was not cooperating. On Feb 23, 5:16 am, Sergio Cambra .:: entreCables - Symbol Servicios Informáticos S.L. ::. ser...@entrecables.com wrote: El Saturday 21 February 2009 16:36:15 RustyHack escribió: I downloaded the plugin and dropped it into my vendor folder. When I start up my app, I get the following message. If anyone has can offer some help here, I would appreciate it. I think you are using activescaffold master branch, you should use rails-2.2 branch. Aaron = /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/ active_support/core_ext/module/aliasing.rb:33:in `alias_method': undefined method `find_template' for class `ActionView::PathSet' (NameError) from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/ active_support/core_ext/module/aliasing.rb:33:in `alias_method_chain' from /Users/rustyhack/Desktop/blackdog/vendor/plugins/ activescaffold- active_scaffold-7b07852464780a8a8894c39d14492992cd15e972/lib/ extensions/generic_view_paths.rb:17 from /usr/local/lib/ruby/site_ruby/1.8/rubygems/ custom_require.rb:31:in `require' from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/ active_support/dependencies.rb:153:in `require' from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/ active_support/dependencies.rb:521:in `new_constants_in' from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/ active_support/dependencies.rb:153:in `require' from /Users/rustyhack/Desktop/blackdog/vendor/plugins/ activescaffold- active_scaffold-7b07852464780a8a8894c39d14492992cd15e972/ environment.rb:4 from
Re: lib/attribute_params.rb attributes_hash_is_empty?
El Tuesday 24 February 2009 16:17:36 Antonio Bardazzi Multicore-Sistemi.com escribió: I'm working with CalendarDateSelect-1.11, AS-1.2RC1, Rails-1.2.0, Ruby-1.8.6. It seems datetime columns from subforms are never saved. If datetimes are not from a subform are saved correctly. Exempla Gratia: 1- My Model has_many time_ranges, each TimeRange has 'from' and 'to' datetimes. 2- model_controller/edit/id has time_ranges subform but do not saves TimeRange at all. With some logger.info steps I've found: AS/lib/attribute_params.rb method attributes_hash_is_empty? ... next true if column and [:boolean, :datetime, :date, :time].include? (column.type) ... Before this method the posted datetimes are OK: params[record] has the correct name and datetimes values are correct, but attributes_hash_is_empty? return true so datetime for my plural association is never saved. For now I changed the line to: ... next true if column and [:boolean].include?(column.type) ... It seems AS still do not save empty records. AS previous to rails-2.2 don't save records with all fields boolean or date. With latest AS (rails 2.2 or higher), you can turn off blank rows and AS won't check for empty records. -- Sergio Cambra .:: entreCables S.L. ::. Nicolás Guillén 6, locales 2 y 3. 50.018 Zaragoza T) 902 021 404 F) 976 52 98 07 E) ser...@entrecables.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups ActiveScaffold : Ruby on Rails plugin group. To post to this group, send email to activescaffold@googlegroups.com To unsubscribe from this group, send email to activescaffold+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/activescaffold?hl=en -~--~~~~--~~--~--~---
has_many_polymorphs acts_as_double_polymorphic_join choking active_scaffold
That pretty much says it all: The joined models are all completely standard The join model only has this: acts_as_double_polymorphic_join( :media =[:photos, :videos], :containers = [:partners, :users], :skip_duplicates = true ) The users controller only has: active_scaffold :users The error raised when I view the scaffold is: Mysql::Error: Unknown column 'container_type' in 'on clause': SELECT count(DISTINCT `partners`.id) AS count_all FROM `partners` LEFT OUTER JOIN `campaigns` ON campaigns.partner_id = partners.id AND container_type = 'Partner' As you probably gather, partner has many campaigns. I've tried disabling that with no joy. I've tried excluding the various columns and also tried explicitly including the join table, but nothing has worked. Any suggestions? It's rails 2.2.2 and 1.2RC1 of active_scaffold. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups ActiveScaffold : Ruby on Rails plugin group. To post to this group, send email to activescaffold@googlegroups.com To unsubscribe from this group, send email to activescaffold+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/activescaffold?hl=en -~--~~~~--~~--~--~---
Re: AS for Rails 2.3?
Sergio Cambra .:: entreCables - Symbol Servicios Informáticos S.L. ::. wrote: Master branch works with rails 2.3, rails-2.2 branch only with rails 2.2 You need render_component plugin to use embedded and nested scaffolds in rails 2.3 When I add the render_component plugin to my project (via Github), I get the following error when I start the server. /Applications/jruby-1.1.6/lib/ruby/gems/1.8/gems/activesupport-2.3.0/lib/active_support/core_ext/module/aliasing.rb:29:in `alias_method_chain': undefined method `set_session_options' for class `ActionController::Base' (NameError) Does render_component have any dependencies? Thanks, Wes --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups ActiveScaffold : Ruby on Rails plugin group. To post to this group, send email to activescaffold@googlegroups.com To unsubscribe from this group, send email to activescaffold+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/activescaffold?hl=en -~--~~~~--~~--~--~---
Re: lib/attribute_params.rb attributes_hash_is_empty?
Many thanks fot the fast answer! Do I have to pay? ;) On 24 Feb, 16:27, Sergio Cambra .:: entreCables - Symbol Servicios Informáticos S.L. ::. ser...@entrecables.com wrote: El Tuesday 24 February 2009 16:17:36 Antonio Bardazzi Multicore-Sistemi.com escribió: I'm working with CalendarDateSelect-1.11, AS-1.2RC1, Rails-1.2.0, Ruby-1.8.6. It seems datetime columns from subforms are never saved. If datetimes are not from a subform are saved correctly. Exempla Gratia: 1- My Model has_many time_ranges, each TimeRange has 'from' and 'to' datetimes. 2- model_controller/edit/id has time_ranges subform but do not saves TimeRange at all. With some logger.info steps I've found: AS/lib/attribute_params.rb method attributes_hash_is_empty? ... next true if column and [:boolean, :datetime, :date, :time].include? (column.type) ... Before this method the posted datetimes are OK: params[record] has the correct name and datetimes values are correct, but attributes_hash_is_empty? return true so datetime for my plural association is never saved. For now I changed the line to: ... next true if column and [:boolean].include?(column.type) ... It seems AS still do not save empty records. AS previous to rails-2.2 don't save records with all fields boolean or date. With latest AS (rails 2.2 or higher), you can turn off blank rows and AS won't check for empty records. -- Sergio Cambra .:: entreCables S.L. ::. Nicolás Guillén 6, locales 2 y 3. 50.018 Zaragoza T) 902 021 404 F) 976 52 98 07 E) ser...@entrecables.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups ActiveScaffold : Ruby on Rails plugin group. To post to this group, send email to activescaffold@googlegroups.com To unsubscribe from this group, send email to activescaffold+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/activescaffold?hl=en -~--~~~~--~~--~--~---
How can I add control to header?
Hi, I want to add control (combobox) to header (see attachment http://download.maksd.ru/active_scaffold_header.png). Can you describe me how can I do it? Thanks, Maxim Dobriakov --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups ActiveScaffold : Ruby on Rails plugin group. To post to this group, send email to activescaffold@googlegroups.com To unsubscribe from this group, send email to activescaffold+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/activescaffold?hl=en -~--~~~~--~~--~--~---
How can I hide some action links for some record?
Hi, I want to hide some action links (see attachment http://download.maksd.ru/hide_some_actions.png). How can I do it? Thanks, Maxim Dobriakov --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups ActiveScaffold : Ruby on Rails plugin group. To post to this group, send email to activescaffold@googlegroups.com To unsubscribe from this group, send email to activescaffold+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/activescaffold?hl=en -~--~~~~--~~--~--~---
Re: How can I add control to header?
I have found solution: http://wiki.github.com/activescaffold/active_scaffold/template-overrides On Feb 24, 10:09 pm, Closer closer.m...@gmail.com wrote: Hi, I want to add control (combobox) to header (see attachmenthttp://download.maksd.ru/active_scaffold_header.png). Can you describe me how can I do it? Thanks, Maxim Dobriakov --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups ActiveScaffold : Ruby on Rails plugin group. To post to this group, send email to activescaffold@googlegroups.com To unsubscribe from this group, send email to activescaffold+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/activescaffold?hl=en -~--~~~~--~~--~--~---
Re: Large text field causes browser error
I'm doing a redirect in the index of the controller: def index #clear the profile session session[:profile] = nil @profile = Profile.find(:all, :conditions = ward_id = '#{session [:ward_id]}') len = @profile.length if len == 0 redirect_to :action = 'new' else #set the profile session @pro = Profile.find(:first, :conditions = ward_id = '#{session [:ward_id]}') session[:profile] = @pro.id #we need to pre load the tables. We start with the income table. redirect_to :action = 'edit', :id = session[:profile] end end Would this make a difference? (Someone else wrote this code and I'm trying to navigate my way through it, btw) On Feb 22, 5:19 pm, Kenny Ortmann kenny.ortm...@gmail.com wrote: when you save it shouldn't be putting anything in the url. are you changing the default routing in any way? can you give an example controller/model/helper of this? On Fri, Feb 20, 2009 at 3:53 PM, Ali awilli...@washoecounty.us wrote: I believe this is a known bug, but I haven't been able to fix it. When saving a text field that is larger than about 1300 characters, the data saves but the redirect puts all that text into the URL and that is apparently too large and so it causes a browser page not found error. Has anyone else experienced this and if so do you have any suggestions on how to work around it? Any input would be greatly appreciated. Thanks, Ali- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups ActiveScaffold : Ruby on Rails plugin group. To post to this group, send email to activescaffold@googlegroups.com To unsubscribe from this group, send email to activescaffold+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/activescaffold?hl=en -~--~~~~--~~--~--~---
Re: AS for Rails 2.3?
I could really use an answer to this--I wish I had the skills to find it myself. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups ActiveScaffold : Ruby on Rails plugin group. To post to this group, send email to activescaffold@googlegroups.com To unsubscribe from this group, send email to activescaffold+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/activescaffold?hl=en -~--~~~~--~~--~--~---
Which version of AS is correct for Rails 2.2.2?
Which version of AS is the right one to use for Rails 2.2.2 and is it stored somewhere other than a branch in a Github project? I need to downgrade to 2.2.2 because of JRuby problems with Rails 2.3. Thanks, Wes --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups ActiveScaffold : Ruby on Rails plugin group. To post to this group, send email to activescaffold@googlegroups.com To unsubscribe from this group, send email to activescaffold+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/activescaffold?hl=en -~--~~~~--~~--~--~---
Re: Installing not working
I tried installing rails gems from github as suggested but it does not find the gems. Anybody tried that? On Feb 24, 10:18 am, Sergio Cambra .:: entreCables - Symbol Servicios Informáticos S.L. ::. ser...@entrecables.com wrote: El Tuesday 24 February 2009 14:24:41 escribió: Sergio, I did some more research on Rails 2.2.2. I have installed rails with gem install rails command. As per rubyforge the gem was created on Nov. 21, 2008. But as per github logs of Rails 2.2-stable branch the find_template method was introduced (I think) after that date. I see there are constant checkins going into rails 2.2-stable branch. Should I be installing rails from github rather than gem? Please advise. I install the gem from github, and I have that method. Try to add github to gem sources and reinstall the gems: rails, actionpack and so on gem sources -ahttp://gems.github.com/ gem install rails activerecord activeresource activesupport actionmailer actionpack Navjeet http://chabbewal.blogspot.com On Tue, Feb 24, 2009 at 8:07 AM, Navjeet navje...@gmail.com wrote: Sergio, I deleted the active_scaffold folder under vendor plugins and got it again from github. I noticed you made an update to init.rb so if one is not Rails 2.2.x an exception is raised. I do not see any such exception so I guess I am using Rails 2.2.2. Is there anyway to verify that Rails 2.2.2 has find_template method implemented? I looked at paths.rb under vendor/rails/actionpack/lib/action_view/ and it does not have find_template method. Thanks. Navjeet http://chabbewal.blogspot.com On Tue, Feb 24, 2009 at 7:42 AM, Navjeet navje...@gmail.com wrote: Sergio, I have been doing that all along. I installed active_scaffold using the command script/plugin install git:// github.com/activescaffold/active_scaffold.git -r rails-2.2 Do I need to issue another command? Navjeet http://chabbewal.blogspot.com On Tue, Feb 24, 2009 at 4:14 AM, Sergio Cambra .:: entreCables - Symbol Servicios Informáticos S.L. ::. ser...@entrecables.com wrote: El Tuesday 24 February 2009 06:39:52 escribió: I am pretty sure I am using rails 2.2.2. Running the command rails - v returns 2.2.2. Just to be sure I froze the gems for my app, and it did say it is freezing to rails 2.2.2 You are right, the line when you get the error is in master branch of active_scaffold. Remove your active_scaffold and try to install again with -r rails-2.2 I don't know why you got master branch instead of rails-2.2 On Feb 23, 10:53 am, Sergio Cambra .:: entreCables - Symbol Servicios Informáticos S.L. ::. ser...@entrecables.com wrote: El Monday 23 February 2009 14:52:39 njs escribió: I think I am using 2.2 branch. Isn't the flag -r rails-2.2 meant to get 2.2 branch? Yes, but I was answering to other mail, and your error trace is different to that trace Are you sure you are using rails 2.2.2? You get an error about find_template doesn't exist in ActionView::PathSet, but that method exist in ActionView::PathSet in rails 2.2, but it doesn't in rails 2.3 BTW sorry for the multiple posts earlier . My browser on xubuntu was not cooperating. On Feb 23, 5:16 am, Sergio Cambra .:: entreCables - Symbol Servicios Informáticos S.L. ::. ser...@entrecables.com wrote: El Saturday 21 February 2009 16:36:15 RustyHack escribió: I downloaded the plugin and dropped it into my vendor folder. When I start up my app, I get the following message. If anyone has can offer some help here, I would appreciate it. I think you are using activescaffold master branch, you should use rails-2.2 branch. Aaron = /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/ active_support/core_ext/module/aliasing.rb:33:in `alias_method': undefined method `find_template' for class `ActionView::PathSet' (NameError) from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/ active_support/core_ext/module/aliasing.rb:33:in `alias_method_chain' from /Users/rustyhack/Desktop/blackdog/vendor/plugins/ activescaffold- active_scaffold-7b07852464780a8a8894c39d14492992cd15e972/lib/ extensions/generic_view_paths.rb:17 from /usr/local/lib/ruby/site_ruby/1.8/rubygems/ custom_require.rb:31:in `require' from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/ active_support/dependencies.rb:153:in `require' from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/ active_support/dependencies.rb:521:in `new_constants_in' from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/
Re: Which version of AS is correct for Rails 2.2.2?
Per the README: branch rails-2.2 Wes Gamble wrote: Which version of AS is the right one to use for Rails 2.2.2 and is it stored somewhere other than a branch in a Github project? I need to downgrade to 2.2.2 because of JRuby problems with Rails 2.3. Thanks, Wes -- -Mike Gaffney (http://rdocul.us) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups ActiveScaffold : Ruby on Rails plugin group. To post to this group, send email to activescaffold@googlegroups.com To unsubscribe from this group, send email to activescaffold+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/activescaffold?hl=en -~--~~~~--~~--~--~---
Was it really necessary to override error_messages_for?
I was going to write a nasty blog post in my frustration since I burned about about two hours trying to figure out wondering why error_messages_for was completely ignoring everything option I threw at it, but ActiveScaffold has saved me about two or three hours on my backend, so I guess it all evens out. Also, it's late and I can't summon anything more than a muted squeal of irritation. Is it really necessary to completely gut error_messages_for? The monkey-patch deal AS has going on in there means it's lacking some of the features that have been added over various Rails releases. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups ActiveScaffold : Ruby on Rails plugin group. To post to this group, send email to activescaffold@googlegroups.com To unsubscribe from this group, send email to activescaffold+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/activescaffold?hl=en -~--~~~~--~~--~--~---