I started programming on the ASP.NET MVC framework a year ago. recently. I am learning Rail Framework on Ruby ASP.NET MVC has the "Custom HTML Assistant" feature, so I can make my own html assistant
<% = Html.MyOwnHtmlHelper ( )% & Gt;
I have learned that Ruby has html helpers such as
<% text_area%>
which presents on HTML
I have a question, can I make my own HTML to create my own HTML?
To create a new helper:
- Choose a name, for example tags_helper.rb
- Create a file in the / app / helpers directory
-
In this case according to a module file name
Module Tags Helper End
-
Define your assistant as the method
Module Tag Helper Def Hello-World ( Name) "Hello # {name}" and end
You can now go to hello_world
assistant and Your view can use the method.
Comments
Post a Comment