Hi Dennis

ActiveScaffold has a setting to show all the actions (same actions displayed in 
the row) on the show action, when open on a page, not inline. It's the partial 
_show_actions.html.erb, called in show.html.erb. There is a helper method that 
you can override to control what links are displayed, display_link_in_show?
(link, position). You can check it to see how it works, but you can't use it 
in your custom view, as it renders the links to load as HTML, not as JS.

You could be just get the link from active_scaffold_config.action_links, and 
render it with render_action_link(link, record, :authorized => true). If you 
want to check if link is authorized, you can use action_link_authorized?(link, 
record)[0].

Regards

El jueves, 23 de marzo de 2023 16:55:17 (CET) Dennis Bulgatz escribió:
> Hi Sergio,
> 
> I have created a custom show template, and would like to provide a link on
> the show template to edit the record.
> 
> I am using TinyMCE, so for the edit link to work properly, it must be
> "processed as JS"
> 
> Using the "Edit Action" from a list view
> Started GET "/sub_tdns/6/edit?adapter=_list_inline_adapter" for ::1 at
> 2023-03-23 10:47:58 -0500
> Processing by SubTdnsController#edit as JS
> 
> 
> Using a link from a helper:  link_to "Edit SubTDN",
> edit_sub_tdn_path(adapter: '_list_inline_adapter')N, class: "button"
> Started GET "/sub_tdns/5/edit?adapter=_list_inline_adapter" for ::1 at
> 2023-03-23 10:48:50 -0500
> Processing by SubTdnsController#edit as HTML
> 
> Possible to use a link_to helper and get the same edit "form" (using JS and
> TinyMCE working) that the "edit" button in the list view renders?
> 
> Assume it might be needed to do this with a custom action in the
> controller?  If so, what would that look like?
> 
> Thanks!
> 
> Dennis




-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/activescaffold/4482034.LvFx2qVVIh%40pc-sergio.

Reply via email to