app/helpers/syntax_helper.rb in vueonrails-0.2.0 vs app/helpers/syntax_helper.rb in vueonrails-0.3.0
- old
+ new
@@ -1,26 +1,26 @@
module SyntaxHelper
def specific_page_vue
- return " #{controller_name} #{action_name} "
+ " #{controller_name} #{action_name} "
end
- def vue_include_tag(version)
- javascript_include_tag "https://cdnjs.cloudflare.com/ajax/libs/vue/#{version}/vue.js" if Rails.env.development?
+ def vue_include_tag
+ javascript_include_tag "https://cdn.jsdelivr.net/npm/vue/dist/vue.js" if Rails.env.development?
end
def rails_version
- "<p>#{Rails.version}</p>".html_safe
+ content_tag :p, Rails.version
end
def vue_on_rails_version
- "<p>#{VueOnRails::VERSION}</p>".html_safe
+ content_tag :p, Vueonrails::VERSION
end
-
+
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|
+ variable.each {|key, value|
concat("<div id=\"vueonrails-#{key}\" data-#{key}=\'#{value}\'>".html_safe)
concat("</div>".html_safe)
}; nil
end
end