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!
def index
@bookmark = Bookmark.new
@bookmarks = Bookmark.sort(:created_at.desc).all
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
- for bookmark in @bookmarks
= render "bookmark", :post => bookmark

View file

@ -25,10 +25,16 @@ $(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() {
@ -39,4 +45,4 @@ $(document).ready(function(){
$('#flash_notice, #flash_error, #flash_alert').delay(1500).slideUp(130);
});//end document ready
});//end document ready