Module: Rails3::Assist::Artifact::View::FileName
- Included in:
- CRUD::Delete::ViewHelper, Rails3::Assist::Artifact::View, Rails3::Assist::Artifact::View
- Defined in:
- lib/rails3_artifactor/artifact/file_name/view.rb
Defined Under Namespace
Modules: Helper
Constant Summary collapse
Instance Method Summary collapse
Instance Method Details
#get_view_args(*args) ⇒ Object
45 46 47 48 49 50 51 52 53 54 |
# File 'lib/rails3_artifactor/artifact/file_name/view.rb', line 45 def get_view_args *args args = args.flatten raise ArgumentError, "view_file_name must be called with one or more arguments to return a view file" if args.size == 0 case args.size when 1 SingleArg.get_view_args *args else TwoArgs.get_view_args *args end end |
#view_file_name(*args) ⇒ Object
35 36 37 38 39 40 41 42 43 |
# File 'lib/rails3_artifactor/artifact/file_name/view.rb', line 35 def view_file_name *args folder, action, type = get_view_args(args) = last_option args root_path = [:root_path] views_path = [:views_path] views_path ||= File.join(root_path, 'app/views') if root_path # puts "views: #{views_path}" File. File.join(views_path || DIR.view_dir, folder.to_s, "#{action}.#{type}") end |