Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for slim #32

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions Support/lib/rails/rails_path.rb
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down