# File app/controllers/entries_controller.rb, line 47 def confirm_destroy end
# File app/controllers/entries_controller.rb, line 19 def create @entry = Entry.new(params[:entry]) if @entry.save redirect_to project_entry_path(@entry.project, @entry), :notice => entry_flash(@entry).html_safe else render :new end end
# File app/controllers/entries_controller.rb, line 50 def destroy @entry.destroy redirect_to(entries_path, :notice => "Awesome. You deleted #{@entry.title}") end
# File app/controllers/entries_controller.rb, line 28 def edit end
# File app/controllers/entries_controller.rb, line 6 def index @entries = current_user.entries.skinny.order(:search_text).paginate :page => params[:page] @tags = current_user.entries.tag_counts_on(:tags).order(:name) end
# File app/controllers/entries_controller.rb, line 11 def new @entry = Entry.new project_guid = params[:project] unless project_guid.blank? @entry.project_id = Project.find_by_guid(project_guid).id end end
# File app/controllers/entries_controller.rb, line 55 def paginate tag_name = params[:tag_name].to_s entries = current_user.entries entries = entries.tagged_with(tag_name) unless tag_name.blank? entries = entries.skinny.order(:search_text).limit(30).offset(params[:idx]) render :json => entries.to_json(:methods => [:project_guid, :project_name]) end
# File app/controllers/entries_controller.rb, line 31 def show respond_to do |format| format.html format.json { render :json => @entry.to_json(:include => [:project], :methods => [:notes, :password, :username, :url, :tags]) } end end
# File app/controllers/entries_controller.rb, line 63 def tagged @tag_name = params[:tag_name].to_s @entries = current_user.entries.tagged_with(@tag_name).order(:search_text) .paginate :page => params[:page] @tags = current_user.entries.tag_counts_on(:tags).order(:name) render :index end
# File app/controllers/entries_controller.rb, line 39 def update if @entry.update_attributes(params[:entry]) redirect_to project_entry_path(@entry.project, @entry), :notice => entry_flash(@entry).html_safe else render :edit end end