我想實現這個軌道生成的形式到我找到的引導形式,並不能找出正確的語法,讓它看起來/工作正確。輸入rails erb語法到引導4形式
這是軌道的erb語法
<%= form_tag users_sessions_path do %>
<%= label_tag :email %>
<%= text_field_tag :email %>
<p>
<%= label_tag :password %>
<%= password_field_tag :password %>
</p>
<p>
<%= submit_tag 'Log In' %>
</p>
<% end %>
,這是自舉形式
<form>
<div class="form-group">
<label for="exampleInputEmail1">Email address</label>
<input type="email" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" placeholder="Email">
<small id="emailHelp" class="form-text text-muted">We'll never share your email with anyone else.</small>
</div>
<div class="form-group">
<label for="exampleInputPassword1">Password</label>
<input type="password" class="form-control" id="exampleInputPassword1" placeholder="Password">
</div>
<div class="form-check">
<label class="form-check-label">
<input type="checkbox" class="form-check-input">
Check me out
</label>
</div>
<button type="submit" class="btn btn-primary">Submit</button>
</form>
謝謝你的幫助,這完全解決了。 –