Removed bookmark new page, moved form to index

This commit is contained in:
ilya 2010-06-25 23:23:37 -04:00
parent f5d1ab14fb
commit d4f528bba8
5 changed files with 19 additions and 18 deletions

View file

@ -2,6 +2,7 @@ class BookmarksController < ApplicationController
before_filter :authenticate_user! before_filter :authenticate_user!
def index def index
@bookmark = Bookmark.new
@bookmarks = Bookmark.sort(:created_at.desc).all @bookmarks = Bookmark.sort(:created_at.desc).all
end end

View file

@ -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

View 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

View file

@ -1,5 +1,5 @@
%h1= link_to "new bookmark", new_bookmark_path %h1.big_text bookmarks
= render "bookmarks/new_bookmark", :bookmark => @bookmark
%ul#stream %ul#stream
- for bookmark in @bookmarks - for bookmark in @bookmarks
= render "bookmark", :post => bookmark = render "bookmark", :post => bookmark

View file

@ -25,9 +25,15 @@ $(document).ready(function(){
$(this).fadeTo(80, 1); $(this).fadeTo(80, 1);
}); });
$('#status_message_message').click(function() { $('#status_message_message').click(clearForm);
$(this).val("")
}); $('#bookmark_title').click(clearForm);
$('#bookmark_link').click(clearForm);
function clearForm(){
$(this).val("");
}
$('#debug_info').click(function() { $('#debug_info').click(function() {
$('#debug_more').toggle('fast', function() { $('#debug_more').toggle('fast', function() {