Ruby on Rails tags vs HTML tags -


i have question tags in .html.erb files.

which practice better: ruby on rails tags or html tags? better use ruby on rails tags as possible? or maybe should avoid them , choose html ones instead? how decide?

using rails tag helpers occur pretty big overhead cost compared writing html tag in erb (or haml or slim). acceptable tradeoff readablity , productivity when working "dynamic html" (in sense of markup created server-side input) totally unnecessary if there no interpolation going on.

basically use common sense - rails tag helpers (and derivatives such form helpers) not meant total replacement writing html in views rather utilities make easier , cleaner bind variables attributes , content of tags. make easier write own helper methods programatically create html instead of using string concatenation.

tldr; using both applicable best practice.


Comments