Skip to content
This repository has been archived by the owner on Aug 15, 2018. It is now read-only.

Commit

Permalink
Merge branch 'jamescook/master' into work
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh Adams committed Dec 16, 2008
2 parents d31eb22 + 2275d5b commit 8a23158
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 14 deletions.
Expand Up @@ -3,6 +3,7 @@
<%= link_to "All Users", admin_users_path, :class => 'button icon back' %>
<% end %>
<% form_for [:admin, @user] do |f| -%>
<%# form_for [:admin, @user] do |f| -%>
<% form_for :user, :url => { :action => "update" } , :html => { :method => :put } do |f| -%>
<%= render :partial => 'form', :locals => { :f => f, :submit_text => "Update User" } -%>
<% end -%>
34 changes: 21 additions & 13 deletions vendor/plugins/theme_support/lib/patches/actionview_ex.rb
Expand Up @@ -4,21 +4,29 @@ module ActionView

# Extending <tt>ActionView::Base</tt> to support rendering themes
class Base
alias_method :theme_support_old_render_file, :render
# Overrides the default <tt>Base#render_file</tt> to allow theme-specific views
def render_file(template_path, use_full_path = false, local_assigns = {})
if( Rails::VERSION::STRING =~ /\A2\.2\.\d/)
alias_method :theme_support_old_render_file, :render
else
alias_method :theme_support_old_render_file, :render_file
end
# Overrides the default <tt>Base#render_file</tt> to allow theme-specific views
def render_file(template_path, use_full_path = false, local_assigns = {})

search_path = [
"#{RAILS_ROOT}/themes/#{controller.current_theme}/views", # for components
"#{RAILS_ROOT}/themes/#{controller.current_theme}", # for layouts
]
search_path = [
"#{RAILS_ROOT}/themes/#{controller.current_theme}/views", # for components
"#{RAILS_ROOT}/themes/#{controller.current_theme}", # for layouts
]

@finder.prepend_view_path(search_path)
local_assigns['active_theme'] = get_current_theme(local_assigns)
if( Rails::VERSION::STRING =~ /\A2\.2\.\d/)
theme_support_old_render_file :file => template_path, :layout => controller.current_theme, :locals => local_assigns
else
theme_support_old_render_file(template_path, use_full_path, local_assigns)
end

end

@finder.prepend_view_path(search_path)
local_assigns['active_theme'] = get_current_theme(local_assigns)
# This isnt right, but it prevents breakage in 2.2.2 -james
theme_support_old_render_file :file => template_path, :layout => true, :locals => local_assigns

end
private

def force_liquid?
Expand Down

0 comments on commit 8a23158

Please sign in to comment.