0

#new 形式のコードがあります。

<%= form_for @phone do |p| %>
  <%= p.label :name %>
  <%= p.text_field :name %>
  <%= p.label :photo %>
  <%= p.text_field :photo %>
  <%= p.submit %>
<% end %>

それを 1 つのコード ブロックに入れることはできますか? また、その方法は?

4

3 に答える 3

1

ビューでの印刷には、次のものが使用されます。

 <%= 'This will be printed in the view' %> 

コードは . なしで使用され=ます。このような:

<% if false%>
<%= 'This will NOT be printed' %>
<% else %>
<%= 'This will be printed' %>
<%end%>
于 2013-10-18T07:59:27.580 に答える