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!
|
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
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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
|
%ul#stream
|
||||||
- for bookmark in @bookmarks
|
- for bookmark in @bookmarks
|
||||||
= render "bookmark", :post => bookmark
|
= render "bookmark", :post => bookmark
|
||||||
|
|
|
||||||
|
|
@ -25,10 +25,16 @@ $(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() {
|
||||||
|
|
||||||
|
|
@ -39,4 +45,4 @@ $(document).ready(function(){
|
||||||
|
|
||||||
$('#flash_notice, #flash_error, #flash_alert').delay(1500).slideUp(130);
|
$('#flash_notice, #flash_error, #flash_alert').delay(1500).slideUp(130);
|
||||||
|
|
||||||
});//end document ready
|
});//end document ready
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue