Grosse MàJ
This commit is contained in:
32
P5B/ruby/mon_projet/app/views/admin/addresses/edit.rhtml
Normal file
32
P5B/ruby/mon_projet/app/views/admin/addresses/edit.rhtml
Normal file
@ -0,0 +1,32 @@
|
||||
<h1>Editing address</h1>
|
||||
|
||||
<%= error_messages_for :address %>
|
||||
|
||||
<% form_for(:address, :url => address_path(@address), :html => { :method => :put }) do |f| %>
|
||||
<p>
|
||||
<b>Street</b><br />
|
||||
<%= f.text_area :street %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Postal code</b><br />
|
||||
<%= f.text_field :postal_code %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>City</b><br />
|
||||
<%= f.text_field :city %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Country</b><br />
|
||||
<%= f.text_field :country %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<%= submit_tag "Update" %>
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
<%= link_to 'Show', address_path(@address) %> |
|
||||
<%= link_to 'Back', addresses_path %>
|
26
P5B/ruby/mon_projet/app/views/admin/addresses/index.rhtml
Normal file
26
P5B/ruby/mon_projet/app/views/admin/addresses/index.rhtml
Normal file
@ -0,0 +1,26 @@
|
||||
<h1>Listing addresses</h1>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>Street</th>
|
||||
<th>Postal code</th>
|
||||
<th>City</th>
|
||||
<th>Country</th>
|
||||
</tr>
|
||||
|
||||
<% for address in @addresses %>
|
||||
<tr>
|
||||
<td><%=h address.street %></td>
|
||||
<td><%=h address.postal_code %></td>
|
||||
<td><%=h address.city %></td>
|
||||
<td><%=h address.country %></td>
|
||||
<td><%= link_to 'Show', address_path(address) %></td>
|
||||
<td><%= link_to 'Edit', edit_address_path(address) %></td>
|
||||
<td><%= link_to 'Destroy', address_path(address), :confirm => 'Are you sure?', :method => :delete %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
|
||||
<br />
|
||||
|
||||
<%= link_to 'New address', new_address_path %>
|
31
P5B/ruby/mon_projet/app/views/admin/addresses/new.rhtml
Normal file
31
P5B/ruby/mon_projet/app/views/admin/addresses/new.rhtml
Normal file
@ -0,0 +1,31 @@
|
||||
<h1>New address</h1>
|
||||
|
||||
<%= error_messages_for :address %>
|
||||
|
||||
<% form_for(:address, :url => addresses_path) do |f| %>
|
||||
<p>
|
||||
<b>Street</b><br />
|
||||
<%= f.text_area :street %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Postal code</b><br />
|
||||
<%= f.text_field :postal_code %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>City</b><br />
|
||||
<%= f.text_field :city %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Country</b><br />
|
||||
<%= f.text_field :country %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<%= submit_tag "Create" %>
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
<%= link_to 'Back', addresses_path %>
|
23
P5B/ruby/mon_projet/app/views/admin/addresses/show.rhtml
Normal file
23
P5B/ruby/mon_projet/app/views/admin/addresses/show.rhtml
Normal file
@ -0,0 +1,23 @@
|
||||
<p>
|
||||
<b>Street:</b>
|
||||
<%=h @address.street %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Postal code:</b>
|
||||
<%=h @address.postal_code %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>City:</b>
|
||||
<%=h @address.city %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Country:</b>
|
||||
<%=h @address.country %>
|
||||
</p>
|
||||
|
||||
|
||||
<%= link_to 'Edit', edit_address_path(@address) %> |
|
||||
<%= link_to 'Back', addresses_path %>
|
Reference in New Issue
Block a user