Hey Sergio,
I have this working correctly for normal list rows but not nested. When I
call a custom edit action it doesn't seem to be getting the right nested
element_row_id
[7] pry(#<#<Class:0x007fdde1ac8480>>)> params
=> {"utf8"=>"✓",
"_method"=>"patch",
"udt_id"=>"22",
"record_id"=>"3",
"eid"=>"",
"association"=>"principal_investigators",
"parent_scaffold"=>"org/org1/intramural_study_oversight_and_statuses1s",
"intramural_study_oversight_and_statuses1_id"=>"88",
"button"=>"",
"controller"=>"org/org1/principal_investigators1s",
"action"=>"update_udt",
"id"=>"3"}
if I call this
[17] pry(#<#<Class:0x007fdde1ac8480>>)> element_row_id(:action => 'list',
:id => @record.id)
=> "as_-list-3-row"
It needs to call this id:
'as_org__org1__intramural_study_oversight_and_statuses1s-88-org__org1__principal_investigators1s-list-13-row'
as that is what active scaffold named it.
nested_id gets me close:
[8] pry(#<#<Class:0x007fdde1ac8480>>)> nested_id
=>
"org/org1/intramural_study_oversight_and_statuses1s-88-org/org1/principal_investigators1s"
Would you happen to know what method will get me this id?
Thanks in advance.
Mark
On Wednesday, April 6, 2016 at 12:05:25 PM UTC-4, Sergio Cambra wrote:
>
> How are you defining link for your custom action? element_row_id should
> return
> right id for embedded scaffold if params[:eid] is present, and it should
> always be added to action links by active scaffold.
>
> El miércoles, 6 de abril de 2016 8:52:04 (CEST) loveand light escribió:
> > Is there a way to access the eid that is used in embeded scaffolds when
> > calling element_row_id from a custom action?
> >
> > The id of the row looks like:
> >
> > as_a3b1686df77ade6385469f0ac5ae9f83-list-9-row
> >
> > But I am creating a custom update action and I don't know how to update
> > this row because I get
> >
> > [ element_row_id(:action => 'update', :id => @record.id)
> > => "as_admin__kg_aliases2s-update-15-row"
> >
> > I am using this to try to update row but I am guessing my custom
> > update/create action doesn't give element_row_id the right id....
> >
> >
> > ActiveScaffold.update_row('<%=element_row_id(:action => 'list', :id =>
> > @record.id)%>','<%=escape_javascript(render(:partial => 'list_record',
> >
> > :locals => {:record => @record}))%>');
> >
> > Thanks in advance.
> > Mark
>
>
>
--
You received this message because you are subscribed to the Google Groups
"ActiveScaffold : Ruby on Rails Gem" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/activescaffold.
For more options, visit https://groups.google.com/d/optout.