forked from wiecklabs/captains_blog
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Woah! Gotta ignore /blogs and not blogs..
- Loading branch information
1 parent
8d9cb24
commit ff3f544
Showing
5 changed files
with
49 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
blogs | ||
pkg | ||
log | ||
*.db | ||
public/assets | ||
/blogs | ||
/public/assets | ||
/log | ||
/pkg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<% | ||
if @blog.new_record? | ||
resource_path = "/admin/blogs" | ||
form_method = :post | ||
offer_delete = false | ||
else | ||
resource_path = "/admin/blogs/#{@blog.id}" | ||
form_method = :put | ||
offer_delete = true | ||
end | ||
%> | ||
<% form resource_path, :method => form_method do %> | ||
<fieldset> | ||
<%= error_messages_for(@blog) %> | ||
|
||
<label for="blog_title">Title</label> | ||
<input type="text" id="blog_title" name="blog[title]" value="<%=h @blog.title %>"> | ||
|
||
<label for="blog_tagline">Tagline</label> | ||
<input type="text" id="blog_tagline" name="blog[tagline]" value="<%=h @blog.tagline %>"> | ||
|
||
<label for="blog_slug">Slug</label> | ||
<input type="text" id="blog_slug" name="blog[slug]" value="<%=h @blog.slug %>"> | ||
|
||
</fieldset> | ||
<input type="submit" value="Save"> | ||
<% end %> | ||
<% if offer_delete %> | ||
<% form(resource_path, :method => :delete) do %> | ||
<input type="submit" value="Delete"> | ||
<% end %> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<%= render "admin/blogs/_form" %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<a href="/admin/blogs/new">New</a> | ||
|
||
<ul> | ||
<% @blogs.each do |blog| %> | ||
<li><a href="/admin/blogs/<%= blog.id %>"><%= blog.title %></a> (<a href="<%= blog_root(blog) %>/admin">admin</a>)</li> | ||
<% end %> | ||
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<%= render "admin/blogs/_form" %> |