It's because the Helper file that is included when the scaffold is nested is the helper file from the Parent controller.
You can put the method in the parent controller as well or include this helper in the parent helper. On Tue, May 12, 2009 at 2:17 PM, G. Sobrinho <[email protected]>wrote: > Hello, > > I having a problem with form_ui and options attributes... Lets see my > situation: > > > *Model Cid with code field using form_ui and options attributes:* > > * # Columns properties > config.columns[:code].form_ui = :masked_input > config.columns[:code].options = {:mask => 'a999'}* > > *Model Care with Scheduled Surgery CID:* > > * # Associations > belongs_to :scheduled_surgery_cid, :class_name => 'Cid'* > > *Helper for masked input:* > > * # Input with jQuery masked input > def active_scaffold_input_masked_input column, options > mask = column.options.delete(:mask) > > if mask.blank? > raise ArgumentError, 'You must specify the mask' > end > > active_scaffold_input_virtual(column, options) + > javascript_tag("jQuery('##{options[:id]}').mask('#{mask}');") > end* > > > Nice... When I use the Cid controller, this works fine. But, when I create > new Care, that have a "Cid" nested, the options attribute is forget throwing > the exception. > > I dumpped the column and options arguments on helper and I receive that: > > * #<ActiveScaffold::DataStructures::Column:0xb64ccbf4 > @associated_limit=3, @sort={:sql=>"cids.\"code\""}, @associated_number=true, > @table="cids", @form_ui=:masked_input, @required=false, > @field="cids.\"code\"", @active_record_class=Cid(id: integer, code: string, > description: string, created_at: datetime, updated_at: datetime), > @options={}, @association=nil, @css_class="", @search_sql="cids.\"code\"", > @includes=[], @name=:code, @weight=0, @show_blank_record=true, > @column=#<ActiveRecord::ConnectionAdapters::SQLiteColumn:0xb6432464 > @default=nil, @sql_type="varchar(255)", @type=:string, @precision=nil, > @primary=false, @limit=255, @null=true, @name="code", @scale=nil>, > @autolink=false> > {:class=>"code-input", :name=>"record[scheduled_surgery_cid][code]", > :id=>"record_code_34_scheduled_surgery_cid"}* > > > See that not have the options on column. But if i dump direct on Cid > controller, I have. It's a ActiveScaffold bug? > > > Thanks > > > > Environment: Rails 2.3.2 with with last commit of ActiveScaffold (Ruby > 1.8.6) > > > > --~--~---------~--~----~------------~-------~--~----~ 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 [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/activescaffold?hl=en -~----------~----~----~----~------~----~------~--~---
