Skip to content

Loading…

add support for slim #32

Open
wants to merge 1 commit into from

1 participant

@johngibb

No description provided.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 30, 2011
  1. @johngibb

    add support for slim

    johngibb committed
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 2 deletions.
  1. +6 −2 Support/lib/rails/rails_path.rb
View
8 Support/lib/rails/rails_path.rb
@@ -139,7 +139,7 @@ def rails_root
end
# This is used in :file_type and :rails_path_for_view
- VIEW_EXTENSIONS = %w( erb builder rhtml rxhtml rxml rjs haml )
+ VIEW_EXTENSIONS = %w( erb builder rhtml rxhtml rxml rjs haml slim )
def file_type
return @file_type if @file_type
@@ -256,7 +256,11 @@ def rails_path_for_view
return nil if action_name.nil?
line, view_format = respond_to_format
- if view_format
+ formats = []
+ formats << view_format if view_format
+ formats << 'html'
+
+ formats.each do |view_format|
VIEW_EXTENSIONS.each do |ext|
filename_with_extension = "#{action_name}.#{view_format}.#{ext}"
existing_view = File.join(rails_root, stubs[:view], modules, controller_name, filename_with_extension)
Something went wrong with that request. Please try again.