The working basics

This commit is contained in:
Godwin
2014-03-09 14:43:33 -06:00
parent b490a97852
commit db60933506
628 changed files with 81918 additions and 1060 deletions
+22
View File
@@ -0,0 +1,22 @@
= form_for @location do |f|
- if @location.errors.any?
#error_explanation
%h2= "#{pluralize(@location.errors.count, "error")} prohibited this location from being saved:"
%ul
- @location.errors.full_messages.each do |msg|
%li= msg
.field
= f.label :title
= f.text_field :title
.field
= f.label :address
= f.text_field :address
.field
= f.label :latitude
= f.text_field :latitude
.field
= f.label :longitude
= f.text_field :longitude
.actions
= f.submit 'Save'
+7
View File
@@ -0,0 +1,7 @@
%h1 Editing location
= render 'form'
= link_to 'Show', @location
\|
= link_to 'Back', locations_path
+25
View File
@@ -0,0 +1,25 @@
%h1 Listing locations
%table
%tr
%th Title
%th Address
%th Latitude
%th Longitude
%th
%th
%th
- @locations.each do |location|
%tr
%td= location.title
%td= location.address
%td= location.latitude
%td= location.longitude
%td= link_to 'Show', location
%td= link_to 'Edit', edit_location_path(location)
%td= link_to 'Destroy', location, :method => :delete, :data => { :confirm => 'Are you sure?' }
%br
= link_to 'New Location', new_location_path
+5
View File
@@ -0,0 +1,5 @@
%h1 New location
= render 'form'
= link_to 'Back', locations_path
+18
View File
@@ -0,0 +1,18 @@
%p#notice= notice
%p
%b Title:
= @location.title
%p
%b Address:
= @location.address
%p
%b Latitude:
= @location.latitude
%p
%b Longitude:
= @location.longitude
= link_to 'Edit', edit_location_path(@location)
\|
= link_to 'Back', locations_path