diff --git a/app/models/page.rb b/app/models/page.rb index 7e7dc50..685311e 100644 --- a/app/models/page.rb +++ b/app/models/page.rb @@ -26,7 +26,7 @@ class Page < ActiveRecord::Base def title_for_url self.title.gsub(/ /, '_') end - + ## # Gets a title from an url name. # diff --git a/app/views/pages/_page.rhtml b/app/views/pages/_page.rhtml index 5fc4b0d..86cc8dd 100644 --- a/app/views/pages/_page.rhtml +++ b/app/views/pages/_page.rhtml @@ -1,9 +1,9 @@
+ <%= text_field 'page', 'title' %> +
++ <%= text_area 'page', 'redcloth' %> +
++ <%= submit_tag "Update" %> +
+<% end %> + +<%= link_to 'Show', page_path({ :id => @page.title_for_url }) %> | +<%= link_to 'Back', pages_path %> diff --git a/app/views/pages/new.rhtml b/app/views/pages/new.rhtml new file mode 100644 index 0000000..fb82989 --- /dev/null +++ b/app/views/pages/new.rhtml @@ -0,0 +1,11 @@ ++ <%= submit_tag "Create" %> +
+<% end %> + +<%= link_to 'Back', pages_path %> \ No newline at end of file diff --git a/app/views/pages/show.rhtml b/app/views/pages/show.rhtml new file mode 100644 index 0000000..a38b777 --- /dev/null +++ b/app/views/pages/show.rhtml @@ -0,0 +1,4 @@ +<%= render :partial => 'page' %> + +<%= link_to 'Edit', edit_page_path({ :id => @page.title_for_url }) %> | +<%= link_to 'Back', pages_path %>