Module: SyntaxHelper
- Defined in:
- app/helpers/syntax_helper.rb
Instance Method Summary collapse
- #rails_version ⇒ Object
- #specific_page_vue ⇒ Object
- #vue_component(identifier, variable = nil) ⇒ Object
- #vue_include_tag ⇒ Object
- #vue_on_rails_version ⇒ Object
Instance Method Details
#rails_version ⇒ Object
10 11 12 |
# File 'app/helpers/syntax_helper.rb', line 10 def rails_version content_tag :p, Rails.version end |
#specific_page_vue ⇒ Object
2 3 4 |
# File 'app/helpers/syntax_helper.rb', line 2 def specific_page_vue " #{controller_name} #{action_name} " end |
#vue_component(identifier, variable = nil) ⇒ Object
18 19 20 21 22 23 24 25 26 27 |
# File 'app/helpers/syntax_helper.rb', line 18 def vue_component(identifier, variable=nil) concat("<div id=\"#{identifier}\" refs=\"#{identifier}\">".html_safe) concat("</div>".html_safe) if(variable != nil) variable.each {|key, value| concat("<div id=\"vueonrails-#{key}\" data-#{key}=\'#{value}\'>".html_safe) concat("</div>".html_safe) }; nil end end |
#vue_include_tag ⇒ Object
6 7 8 |
# File 'app/helpers/syntax_helper.rb', line 6 def vue_include_tag javascript_include_tag "https://cdn.jsdelivr.net/npm/vue/dist/vue.js" if Rails.env.development? end |
#vue_on_rails_version ⇒ Object
14 15 16 |
# File 'app/helpers/syntax_helper.rb', line 14 def vue_on_rails_version content_tag :p, Vueonrails::VERSION end |