Removed bookmark new page, moved form to index
This commit is contained in:
parent
f5d1ab14fb
commit
d4f528bba8
5 changed files with 19 additions and 18 deletions
|
|
@ -2,6 +2,7 @@ class BookmarksController < ApplicationController
|
|||
before_filter :authenticate_user!
|
||||
|
||||
def index
|
||||
@bookmark = Bookmark.new
|
||||
@bookmarks = Bookmark.sort(:created_at.desc).all
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -1,12 +0,0 @@
|
|||
= form_for @bookmark do |f|
|
||||
= f.error_messages
|
||||
%p
|
||||
= f.label :title
|
||||
%br
|
||||
= f.text_field :title
|
||||
%p
|
||||
= f.label :link
|
||||
%br
|
||||
= f.text_field :link
|
||||
%p
|
||||
= f.submit
|
||||
6
app/views/bookmarks/_new_bookmark.haml
Normal file
6
app/views/bookmarks/_new_bookmark.haml
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
= form_for @bookmark, :remote => true do |f|
|
||||
= f.error_messages
|
||||
= f.text_field :title, :value => "Title"
|
||||
= f.text_field :link, :value => "URL"
|
||||
%p
|
||||
= f.submit
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
%h1= link_to "new bookmark", new_bookmark_path
|
||||
|
||||
%h1.big_text bookmarks
|
||||
= render "bookmarks/new_bookmark", :bookmark => @bookmark
|
||||
%ul#stream
|
||||
- for bookmark in @bookmarks
|
||||
= render "bookmark", :post => bookmark
|
||||
|
|
|
|||
|
|
@ -25,9 +25,15 @@ $(document).ready(function(){
|
|||
$(this).fadeTo(80, 1);
|
||||
});
|
||||
|
||||
$('#status_message_message').click(function() {
|
||||
$(this).val("")
|
||||
});
|
||||
$('#status_message_message').click(clearForm);
|
||||
|
||||
$('#bookmark_title').click(clearForm);
|
||||
|
||||
$('#bookmark_link').click(clearForm);
|
||||
|
||||
function clearForm(){
|
||||
$(this).val("");
|
||||
}
|
||||
|
||||
$('#debug_info').click(function() {
|
||||
$('#debug_more').toggle('fast', function() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue