Thanks, I missed this one becuase I use 1.8.7, although I'm not sure why it
worked.
>
> class LookupContext
> module ViewPaths
> def find_all_templates(name, partial = false, locals = {})
> prefixes.collect do |prefix|
> view_paths.collect do |resolver|
> temp_args = *args_for_lookup(name, [prefix], partial,
> locals )
> temp_args[1] = temp_args[1][0]
> resolver.find_all(*temp_args)
> end
> end.flatten!
> end
> end
> end
>
> The second issue I've run into is that @_view_stack is nil if I call
> render :super in the first view and not the partial. Seems like the
> stack only gets added to from render called in the view. Therefor I
> get an error when I call render :super in list.html.erb, but not if I
> call it in _list.html.erb.
I have fixed it. I dislike this fix because it uses a internal variable, which
could be removed in a later version, but render :super it's really a hack too,
so another hack more is not very important.
--
Sergio Cambra .:: entreCables S.L. ::.
Mariana Pineda 23, 50.018 Zaragoza
T) 902 021 404 F) 976 52 98 07 E) ser...@entrecables.com
Thanks. Probably it's very hacky, but I can't find a better way to get all
templates. Previously we shifted view paths for each render :super, so used
view_paths was ignored. But search is nested iteration, so it doesn't work
now.
I hope lookup templates code won't change in next rails versions
actionpack (3.2.1) lib/action_view/lookup_context.rb:137:in `args_for_lookup'
active_scaffold (3.1.18) lib/active_scaffold/extensions/action_view_rendering.rb:7:in `block (2 levels) in find_all_templates'
actionpack (3.2.1) lib/action_view/path_set.rb:38:in `each'
actionpack (3.2.1) lib/action_view/path_set.rb:38:in `each'
active_scaffold (3.1.18) lib/active_scaffold/extensions/action_view_rendering.rb:6:in `collect'
active_scaffold (3.1.18) lib/active_scaffold/extensions/action_view_rendering.rb:6:in `block in find_all_templates'
active_scaffold (3.1.18) lib/active_scaffold/extensions/action_view_rendering.rb:5:in `collect'
active_scaffold (3.1.18) lib/active_scaffold/extensions/action_view_rendering.rb:5:in `find_all_templates'
active_scaffold (3.1.18) lib/active_scaffold/extensions/action_view_rendering.rb:49:in `render_with_active_scaffold'
haml (3.1.4) lib/haml/helpers/action_view_mods.rb:11:in `block in render_with_haml'
haml (3.1.4) lib/haml/helpers.rb:90:in `non_haml'
haml (3.1.4) lib/haml/helpers/action_view_mods.rb:11:in `render_with_haml'You can try with config.label or config.list.label in a before filter,
but it could not be enough if you need to set html tags for example.
I have fixes rails 3.2 issues, I will release a new version tomorrow.
>
> --
> You received this message because you are subscribed to the Google
> Groups "ActiveScaffold : Ruby on Rails plugin" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/activescaffold/-/P3xFEkkxyR0J [2].
> 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]
> https://github.com/activescaffold/active_scaffold/wiki/Template-Overrides/_compare/9e1cb62a776d84499db7ed6d62c75d9a0a7efc4a...1b68b78c8629c7f6d2c233a7a673a97b2a8915fe
> [2] https://groups.google.com/d/msg/activescaffold/-/P3xFEkkxyR0J
Sorry - by page title I meant <title> not the <h2>. I guess I could
do that with a before filter, but then it couldn't change per action.
> I have fixes rails 3.2 issues, I will release a new version tomorrow.
Thanks :)
You can change per action with a before_filter, testing action_name and setting
an instance variable. Also you can use a helper method in your layout to set
the title. Or override the index action. It's up to you, but there are some
options. Maybe using a helper method has better performance than overriding
list view and using render :super.
Thanks, I'll give those ideas a go :)