-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor so both modules can be used together
- Loading branch information
1 parent
91e876e
commit 6452319
Showing
3 changed files
with
36 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# frozen_string_literal: true | ||
|
||
module Phlexible | ||
module Rails | ||
module ActionController | ||
module Base | ||
|
||
protected | ||
|
||
def phlex_view(options) | ||
phlex_view_path(options)&.camelize&.safe_constantize | ||
end | ||
|
||
def phlex_view_path(options) | ||
if options[:action] | ||
"/#{controller_path}/#{options[:action]}_view" | ||
elsif options[:template] | ||
"/#{options[:template]}_view" | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters