Rails: how to insert a text field without a form to check layout?

I am just making a layout for my application at the moment, and I want to insert a text box that does nothing to see what it looks like. How can i do this?

+8
input ruby ruby-on-rails forms
source share
1 answer

There are several ways to do what you want.

1) just write static HTML

<input type="text" name="dummy" /> 

2) Using text_field_tag

 <%= text_field_tag "dummy", nil %> 

3) Building a dummy form using form_for for a dummy object

 <%= form_for SomeModel.new do |f| %> <%= f.text_field :column_name %> <% end %> 
+19
source share

All Articles