Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Getting' my partial on for events

  • Loading branch information...
commit d0347846f8d22be83b003116fcd501d2108eb508 1 parent b9ad4a3
@joshe authored
View
6 app/views/events/_event_fields.html.haml
@@ -0,0 +1,6 @@
+= form_for @event, :as => :event, :url => { :action => "create" } do |e|
+ = e.text_field :event_title, :placeholder => "Event title"
+ = e.text_field :event_cost, :placeholder => "Cost"
+ = e.text_field :event_planner, :placeholder => "Planner"
+
+ = submit_tag "Save"
View
9 app/views/events/edit.html.haml
@@ -1,8 +1,3 @@
-%h1 Edit Event
+%h4 Edit Event
= link_to "back to event page", event_path(@event.id)
-= form_for @event, :as => :event, :url => { :action => "update" } do |e|
- = e.text_field :event_title
- = e.text_field :event_cost
- = e.text_field :event_planner
-
- = submit_tag "Update"
+= render "event_fields"
View
9 app/views/events/new.html.haml
@@ -1,7 +1,2 @@
-%h1 New Event
-= form_for @event, :as => :event, :url => { :action => "create" } do |e|
- = e.text_field :event_title, :placeholder => "Event title"
- = e.text_field :event_cost, :placeholder => "Cost"
- = e.text_field :event_planner, :placeholder => "Planner"
-
- = submit_tag "Save"
+%h4 New Event
+= render "event_fields"
View
2  app/views/events/show.html.haml
@@ -1,4 +1,4 @@
-%h1= @event.event_title
+%h4= @event.event_title
= link_to "< back to all events", events_path
= link_to "edit", edit_event_path
%p= "Cost: $#{@event.event_cost}"
Please sign in to comment.
Something went wrong with that request. Please try again.