closing nested AS - wrong link

57 views
Skip to first unread message

Hernan Astudillo

unread,
May 10, 2012, 12:53:51 PM5/10/12
to activescaffold
when i open a nested scaffold, the closing link doesn't work at all, because the link generated is like:

<a class="inline-adapter-close as_cancel" title="Cerrar" data-remote="true" data-refresh="true" href="/assets?_method=get&action=row&controller=postulaciones&id=1">Cerrar</a>

And as you can see, the url is wrong /assets?

and Router complains:

Started GET "/assets?_method=get&action=row&controller=postulaciones&id=1" for 127.0.0.1 at 2012-05-10 12:32:02 -0400
Served asset  - 404 Not Found (3ms)

ActionController::RoutingError (No route matches [GET] "/assets"):
...


So, if template doesn't set a link :

<%= link_to(as_(:close), '', :class => 'inline-adapter-close as_cancel', :remote => true, :title => as_(:close), 'data-refresh' => (action_name == 'index' ? true : false)) -%>


Where is that link coming from?
Happens with all my nested scaffolds.
Doesn't happen with inline "show" or "update" associated
I'm not overriding forms

cheers,

ser...@entrecables.com

unread,
May 16, 2012, 6:52:54 PM5/16/12
to actives...@googlegroups.com
IIRC I have fixed, can you try with master branch?

On Thu, 10 May 2012 12:53:51 -0400, Hernan Astudillo <naa...@gmail.com>
wrote:
> when i open a nested scaffold, the closing link doesn't work at all,
> because the link generated is like:
>
> Cerrar
>
> And as you can see, the url is wrong /assets?
>
> and Router complains:
>
> Started GET
> "/assets?_method=get&action=row&controller=postulaciones&id=1" for
> 127.0.0.1 at 2012-05-10 12:32:02 -0400
> Served asset  - 404 Not Found (3ms)
>
> ActionController::RoutingError (No route matches [GET] "/assets"):
> ...
>
> So, if template doesn't set a link :
>
> 'inline-adapter-close as_cancel', :remote => true, :title =>
> as_(:close), 'data-refresh' => (action_name == 'index' ? true :
> false)) -%>
>
> Where is that link coming from?
> Happens with all my nested scaffolds.
> Doesn't happen with inline "show" or "update" associated
> I'm not overriding forms
>
> cheers,
>
> --
> 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 actives...@googlegroups.com.
> To unsubscribe from this group, send email to
> activescaffol...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/activescaffold?hl=en.

Hernan Astudillo

unread,
May 17, 2012, 1:27:21 PM5/17/12
to actives...@googlegroups.com
mmm nope.. still same:

Using latest commit (log output):
.../bundler/gems/active_scaffold-9d1803c0a272/...

html close link:
http://localhost:3000/assets?_method=get&action=row&controller=postulaciones&id=1

console output after clicking:
Started GET "/assets?_method=get&action=row&controller=postulaciones&id=1" for 127.0.0.1 at 2012-05-17 13:10:00 -0400

Served asset  - 404 Not Found (3ms)

i have nothing overrided nor configured in any controller. It happens with all nested associations.

ser...@entrecables.com

unread,
May 21, 2012, 6:52:52 PM5/21/12
to actives...@googlegroups.com
I have just got it in a nested controller, but in edit and delete links
instead of closing link. I got those wrong links becuase I had excluded
edit and destroy in the routes. Do you have set :active_scaffold =>
true, or defined row route, in your parent controller routes?

On Thu, 17 May 2012 13:27:21 -0400, Hernan Astudillo <naa...@gmail.com>
wrote:
> mmm nope.. still same:
>
> Using latest commit (log output):
> .../bundler/gems/active_scaffold-9d1803c0a272/...
>
> html close link:
> http://localhost:3000/assets?_method=get&action=row&controller=postulaciones&id=1
> [1]
>
> console output after clicking:
> Started GET
> "/assets?_method=get&action=row&controller=postulaciones&id=1" for
> 127.0.0.1 at 2012-05-17 13:10:00 -0400
> Served asset  - 404 Not Found (3ms)
>
> i have nothing overrided nor configured in any controller. It happens
> with all nested associations.
>
> On Wed, May 16, 2012 at 6:52 PM, wrote:
> IIRC I have fixed, can you try with master branch?
>
> On Thu, 10 May 2012 12:53:51 -0400, Hernan Astudillo
> actives...@googlegroups.com [4].
> >  To unsubscribe from this group, send email to
> > activescaffol...@googlegroups.com [5].
> >  For more options, visit this group at
> > http://groups.google.com/group/activescaffold?hl=en [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 actives...@googlegroups.com
> [7].
> To unsubscribe from this group, send email to
> activescaffol...@googlegroups.com [8].
> For more options, visit this group at
> http://groups.google.com/group/activescaffold?hl=en [9].
>
> --
> 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 actives...@googlegroups.com.
> To unsubscribe from this group, send email to
> activescaffol...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/activescaffold?hl=en.
>
>
> Links:
> ------
> [1]
> http://localhost:3000/assets?_method=get&action=row&controller=postulaciones&id=1
> [2] mailto:ser...@entrecables.com
> [3] mailto:naa...@gmail.com
> [4] mailto:actives...@googlegroups.com
> [5] mailto:activescaffold%2Bunsu...@googlegroups.com
> [6] http://groups.google.com/group/activescaffold?hl=en
> [7] mailto:actives...@googlegroups.com
> [8] mailto:activescaffold%2Bunsu...@googlegroups.com
> [9] http://groups.google.com/group/activescaffold?hl=en

Hernan Astudillo

unread,
May 25, 2012, 12:27:01 PM5/25/12
to actives...@googlegroups.com
just the basic "do as_routes end" for each resource.
I know you're busy, so i want to dig it myself, but can you point me where AS generates urls? can't find them

cheers,

Hernan Astudillo

unread,
May 25, 2012, 2:27:12 PM5/25/12
to actives...@googlegroups.com
Ok found it. 2 things actually:

1.- my mistake, i had "def as_routes end" in routes.rb for testing without AS.
2.- i found
as_action_aliases
in cancan bridge, which is meant to be used in ability.rb. It should be documented, however, could we do the alias_chain_method trick to skip this step?

Otherwise i'll put that in the wiki.

regards,

Hernan Astudillo

unread,
May 25, 2012, 2:36:13 PM5/25/12
to actives...@googlegroups.com
wiki updated, for now.

ser...@entrecables.com

unread,
May 26, 2012, 3:58:04 AM5/26/12
to actives...@googlegroups.com
It was explained inside CanCan wiki page.

IIRC bridge author didn't want to alias_chain_method, so you get some
security changes without being aware of that.
Discussion in issue #138
https://github.com/activescaffold/active_scaffold/issues/138

On Fri, 25 May 2012 14:27:12 -0400, Hernan Astudillo <naa...@gmail.com>
wrote:
> Ok found it. 2 things actually:
>
> 1.- my mistake, i had "def as_routes end" in routes.rb for testing
> without AS.
> 2.- i found
>
> as_action_aliases
> in cancan bridge, which is meant to be used in ability.rb. It should
> be documented, however, could we do the alias_chain_method trick to
> skip this step?
>
> Otherwise i'll put that in the wiki.
>
> regards,
>
> On Fri, May 25, 2012 at 12:27 PM, Hernan Astudillo wrote:
> just the basic "do as_routes end" for each resource.
> I know you're busy, so i want to dig it myself, but can you point me
> where AS generates urls? can't find them
>
> cheers,
>
> On Mon, May 21, 2012 at 6:52 PM, wrote:
> I have just got it in a nested controller, but in edit and delete
> links
> instead of closing link. I got those wrong links becuase I had
> excluded
> edit and destroy in the routes. Do you have set :active_scaffold =>
> true, or defined row route, in your parent controller routes?
>
> On Thu, 17 May 2012 13:27:21 -0400, Hernan Astudillo
> wrote:
>
>> mmm nope.. still same:
> >
> > Using latest commit (log output):
> > .../bundler/gems/active_scaffold-9d1803c0a272/...
> >
> > html close link:
> >
> http://localhost:3000/assets?_method=get&action=row&controller=postulaciones&id=1
> [4]
> > actives...@googlegroups.com [5] [4].
>
>>  >  To unsubscribe from this group, send email to
> >  > activescaffol...@googlegroups.com [6] [5].
>
>>  >  For more options, visit this group at
> >  > http://groups.google.com/group/activescaffold?hl=en [7] [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
> actives...@googlegroups.com [8]
> > [7].
>
>>  To unsubscribe from this group, send email to
> > activescaffol...@googlegroups.com [9] [8].
>
>>  For more options, visit this group at
> > http://groups.google.com/group/activescaffold?hl=en [10] [9].
>
>>
> >  --
> >  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
> actives...@googlegroups.com [11].
> >  To unsubscribe from this group, send email to
> > activescaffol...@googlegroups.com [12].
> >  For more options, visit this group at
> > http://groups.google.com/group/activescaffold?hl=en [13].
> [14]
> > [2] mailto:ser...@entrecables.com [15]
> > [3] mailto:naa...@gmail.com [16]
> > [4] mailto:actives...@googlegroups.com [17]
> > [5] mailto:activescaffold%2Bunsu...@googlegroups.com [18]
> > [6] http://groups.google.com/group/activescaffold?hl=en [19]
> > [7] mailto:actives...@googlegroups.com [20]
> > [8] mailto:activescaffold%2Bunsu...@googlegroups.com [21]
> > [9] http://groups.google.com/group/activescaffold?hl=en [22]
>
> --
> 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 actives...@googlegroups.com
> [23].
> To unsubscribe from this group, send email to
> activescaffol...@googlegroups.com [24].
> For more options, visit this group at
> http://groups.google.com/group/activescaffold?hl=en [25].
>
> --
> 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 actives...@googlegroups.com.
> To unsubscribe from this group, send email to
> activescaffol...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/activescaffold?hl=en.
>
>
> Links:
> ------
> [1] mailto:naa...@gmail.com
> [2] mailto:ser...@entrecables.com
> [3] mailto:naa...@gmail.com
> [4]
> http://localhost:3000/assets?_method=get&action=row&controller=postulaciones&id=1
> [5] mailto:actives...@googlegroups.com
> [6] mailto:activescaffold%2Bunsu...@googlegroups.com
> [7] http://groups.google.com/group/activescaffold?hl=en
> [8] mailto:actives...@googlegroups.com
> [9] mailto:activescaffold%2Bunsu...@googlegroups.com
> [10] http://groups.google.com/group/activescaffold?hl=en
> [11] mailto:actives...@googlegroups.com
> [12] mailto:activescaffold%2Bunsu...@googlegroups.com
> [13] http://groups.google.com/group/activescaffold?hl=en
> [14]
> http://localhost:3000/assets?_method=get&action=row&controller=postulaciones&id=1
> [15] mailto:ser...@entrecables.com
> [16] mailto:naa...@gmail.com
> [17] mailto:actives...@googlegroups.com
> [18] mailto:activescaffold%252Buns...@googlegroups.com
> [19] http://groups.google.com/group/activescaffold?hl=en
> [20] mailto:actives...@googlegroups.com
> [21] mailto:activescaffold%252Buns...@googlegroups.com
> [22] http://groups.google.com/group/activescaffold?hl=en
> [23] mailto:actives...@googlegroups.com
> [24] mailto:activescaffold%2Bunsu...@googlegroups.com
> [25] http://groups.google.com/group/activescaffold?hl=en

Reply all
Reply to author
Forward
0 new messages