Just a heads up, removing render component from nested scaffolds is in the works so once that happens you may need to change the way you are doing this, or better case scenario is that it will just work and pass the params correctly without you having to do anything.
On Wed, May 27, 2009 at 9:43 AM, Sylvain <[email protected]>wrote: > > Thanks Volker, > that works! > > > > On 27 mai, 08:57, "[email protected]" > <[email protected]> wrote: > > Take a look at file _nested.html: > > > > concat render(:active_scaffold => controller.controller_path, > > :constraints => @constraints, > > :conditions => association.options[:conditions], > > :label => h(@label), > > :params => {:nested => true, :parent_column => > > column_name, :parent_model => association.active_record} > > > > It s not possible to pass a param to the nested controller as you can > > see. > > > > I had a similar issue in the past and have rewritten that part of > > activescaffold, however I m stil on a quite old version of > > activescaffold. > > > > The easy solution for you would be to overwrite _nested.html in your > > controller view path to fit your needs. You just have to add your > > param to the params hash. > > > > -- > > Volker > > > > On May 26, 1:15 pm, Sylvain <[email protected]> wrote: > > > > > Hi all, > > > I have a problem > > > I have a view of "connections". Those connections have many paths > > > (from 2 to a lot) > > > These paths can have flaws (one or several) or not. > > > > > So my model is the following: > > > > > class AspenConnection > > > has_many :paths > > > > > class Path > > > belongs_to :aspen_connection > > > has_many :flaws > > > > > class flaws > > > belongs_to :path > > > > > In one view, I would like to represent the connexions where one or > > > more path have flaws. > > > For the nested view of the path, I would like to show at this specific > > > view only the paths having a flaw. > > > I've been able to add a parameter in the link for the nested view: > http://localhost:8080/cnx/19273/nested?_method=get&associations=paths... > > > (this is tare_type in the example) > > > But this parameter is not given to the path controller: > > > > > Processing AspenConnectionsController#nested (for 127.0.0.1 at > > > 2009-05-26 13:10:21) [GET] > > > Parameters: {"_method"=>"get", "aspen_topo_file_id"=>"66", > > > "associations"=>"paths", "eid"=>"e8db239c4f82e8c042dbfe67079782bc", > > > "tare_type"=>"0", "adapter"=>"_list_inline_adapter", > > > "controller"=>"aspen_connections", "action"=>"nested", "id"=>"19430"} > > > Start rendering component > > > ({:controller=>"paths", :action=>"table", :params=> > > > {:nested=>true, :parent_column=>"paths", :parent_model=>AspenConnection > > > (id: integer, activity_status: string, broadcast_cir: integer, > > > broadcast_eir: integer, creation_mode: string, description: string, > > > name: string, dual_homed_reversion_timeout: integer, external_id: > > > string, aspen_id: integer, loopback: boolean, path_status: string, > > > reversion_timeout: integer, status: string, status_description: > > > string, tls_type: integer, nsn_type: integer, under_operation: > > > boolean, use_agg_tunnel: boolean, use_spreading_algorithm: boolean, > > > protection_id: integer, customer_id: integer, error_flag: string, > > > aspen_topo_file_id: integer, created_at: datetime, updated_at: > > > datetime), :eid=>"9fd0a52bcfe1155cfb97d5481baa3dc5"}}): > > > > > Processing PathsController#table (for 127.0.0.1 at 2009-05-26 > > > 13:10:21) [GET] > > > Parameters: {"nested"=>true, "parent_column"=>"paths", > > > "parent_model"=>AspenConnection(id: integer, activity_status: string, > > > broadcast_cir: integer, broadcast_eir: integer, creation_mode: string, > > > description: string, name: string, dual_homed_reversion_timeout: > > > integer, external_id: string, aspen_id: integer, loopback: boolean, > > > path_status: string, reversion_timeout: integer, status: string, > > > status_description: string, tls_type: integer, nsn_type: integer, > > > under_operation: boolean, use_agg_tunnel: boolean, > > > use_spreading_algorithm: boolean, protection_id: integer, customer_id: > > > integer, error_flag: string, aspen_topo_file_id: integer, created_at: > > > datetime, updated_at: datetime), > > > "eid"=>"9fd0a52bcfe1155cfb97d5481baa3dc5", "controller"=>"paths", > > > "action"=>"table", "id"=>nil} > > > > > The param "tare_type" which allow me to know (in the condition for > > > collection of path) what to take is not given to the PathsController > > > > > Any idea on how to give the param or on how to reach the result (being > > > able to restrain the content of a nested associated table sometimes > > > only)? > > > > > Thanks in advance, > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
