/notes: default to listing notes, not posts. Remove group_by=post.
The posts listing is replaced by a link to order:note.
This commit is contained in:
@@ -6,10 +6,11 @@ class NotesController < ApplicationController
|
||||
end
|
||||
|
||||
def index
|
||||
if params[:group_by] == "note"
|
||||
index_by_note
|
||||
else
|
||||
index_by_post
|
||||
@notes = Note.search(params[:search]).order("id desc").paginate(params[:page], :limit => params[:limit], :search_count => params[:search])
|
||||
respond_with(@notes) do |format|
|
||||
format.xml do
|
||||
render :xml => @notes.to_xml(:root => "notes")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -66,25 +67,4 @@ private
|
||||
def create_params
|
||||
params.require(:note).permit(:x, :y, :width, :height, :body, :post_id, :html_id)
|
||||
end
|
||||
|
||||
def index_by_post
|
||||
@post_set = PostSets::Note.new(params)
|
||||
@posts = @post_set.posts
|
||||
respond_with(@posts) do |format|
|
||||
format.html {render :action => "index_by_post"}
|
||||
format.xml do
|
||||
render :xml => @posts.to_xml(:root => "posts")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def index_by_note
|
||||
@notes = Note.search(params[:search]).order("id desc").paginate(params[:page], :limit => params[:limit], :search_count => params[:search])
|
||||
respond_with(@notes) do |format|
|
||||
format.html {render :action => "index_by_note"}
|
||||
format.xml do
|
||||
render :xml => @notes.to_xml(:root => "notes")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user