diff --git a/app/views/sites/edit.html.erb b/app/views/sites/edit.html.erb deleted file mode 100644 --- a/app/views/sites/edit.html.erb +++ /dev/null @@ -1,32 +0,0 @@ -
- Name
- <%= f.text_field :name %>
-
- Password
- <%= f.text_field :password %>
-
- Started
- <%= f.check_box :started %>
-
- Start time
- <%= f.datetime_select :start_time %>
-
- <%= f.submit "Update" %> -
-<% end %> - -<%= link_to 'Show', @site %> | -<%= link_to 'Back', sites_path %> diff --git a/app/views/sites/edit.html.haml b/app/views/sites/edit.html.haml new file mode 100644 --- /dev/null +++ b/app/views/sites/edit.html.haml @@ -0,0 +1,24 @@ +%h1 Editing site += error_messages_for :site += form_for(@site) do |f| + %p + %b Name + %br/ + = f.text_field :name + %p + %b Password + %br/ + = f.text_field :password + %p + %b Started + %br/ + = f.check_box :started + %p + %b Start time + %br/ + = f.datetime_select :start_time, :include_blank => true + %p + = f.submit "Update" += link_to 'Show', @site +| += link_to 'Back', sites_path diff --git a/app/views/sites/index.html.erb b/app/views/sites/index.html.erb deleted file mode 100644 --- a/app/views/sites/index.html.erb +++ /dev/null @@ -1,29 +0,0 @@ -Name | -Password | -Started | -Start time | -|||
---|---|---|---|---|---|---|
<%=h site.name %> | -<%=h site.password %> | -<%=h site.started %> | -<%=h site.start_time %> | -<%= link_to 'Show', site %> | -<%= link_to 'Edit', edit_site_path(site) %> | -<%= link_to 'Destroy', site, :confirm => 'Are you sure?', :method => :delete %> | -
- Name
- <%= f.text_field :name %>
-
- Password
- <%= f.text_field :password %>
-
- Started
- <%= f.check_box :started %>
-
- Start time
- <%= f.datetime_select :start_time %>
-
- <%= f.submit "Create" %> -
-<% end %> - -<%= link_to 'Back', sites_path %> diff --git a/app/views/sites/new.html.haml b/app/views/sites/new.html.haml new file mode 100644 --- /dev/null +++ b/app/views/sites/new.html.haml @@ -0,0 +1,22 @@ +%h1 New site += error_messages_for :site += form_for(@site) do |f| + %p + %b Name + %br/ + = f.text_field :name + %p + %b Password + %br/ + = f.text_field :password + %p + %b Started + %br/ + = f.check_box :started + %p + %b Start time + %br/ + = f.datetime_select :start_time + %p + = f.submit "Create" += link_to 'Back', sites_path diff --git a/app/views/sites/show.html.erb b/app/views/sites/show.html.erb deleted file mode 100644 --- a/app/views/sites/show.html.erb +++ /dev/null @@ -1,23 +0,0 @@ -- Name: - <%=h @site.name %> -
- -- Password: - <%=h @site.password %> -
- -- Started: - <%=h @site.started %> -
- -- Start time: - <%=h @site.start_time %> -
- - -<%= link_to 'Edit', edit_site_path(@site) %> | -<%= link_to 'Back', sites_path %> diff --git a/app/views/sites/show.html.haml b/app/views/sites/show.html.haml new file mode 100644 --- /dev/null +++ b/app/views/sites/show.html.haml @@ -0,0 +1,15 @@ +%p + %b Name: + = h @site.name +%p + %b Password: + = h @site.password +%p + %b Started: + = h @site.started +%p + %b Start time: + = h @site.start_time += link_to 'Edit', edit_site_path(@site) +| += link_to 'Back', sites_path