I am a newbie to Rails and I have seen that to write HTML code, rails provide you with hepler classes. So I am under an impression that writing HTML code directly in a rails application is not considered good.
What I did was used a form helper class to generate a form in html as follows:
<%= form_for @sub do |s| %>
<%= s.text_field :email %>
<%= s.submit 'Sign up' %>
I am a back end developer and so far it was good, but when I got the front end html the code was:
<div id="subscribe">
<form action='/subscribers' method='post'>
<input id='subscriber_email' name='subscriber[email]' type="email" placeholder="email address" required="required">
<input name='commit' type="submit" value="➔">
</form>
</div>
how can i add classes and types to tags using actionview?
Have a look at the documentation about the ActionView Formhelpers.
You can set the classes easily in the backend by adding the class attribute: