From 8b4e4e76a4cd168ab0c29028e8ae240bd97814d4 Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Sat, 7 Nov 2020 12:31:26 +0000 Subject: [PATCH] use "do end" instead of {} at WikiController git-svn-id: http://svn.redmine.org/redmine/trunk@20290 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/controllers/wiki_controller.rb | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/app/controllers/wiki_controller.rb b/app/controllers/wiki_controller.rb index 2bfeb24e8..782763713 100644 --- a/app/controllers/wiki_controller.rb +++ b/app/controllers/wiki_controller.rb @@ -49,9 +49,9 @@ class WikiController < ApplicationController load_pages_for_index respond_to do |format| - format.html { + format.html do @pages_by_parent_id = @pages.group_by(&:parent_id) - } + end format.api end end @@ -184,17 +184,17 @@ class WikiController < ApplicationController call_hook(:controller_wiki_edit_after_save, { :params => params, :page => @page}) respond_to do |format| - format.html { + format.html do anchor = @section ? "section-#{@section}" : nil redirect_to project_wiki_page_path(@project, @page.title, :anchor => anchor) - } - format.api { + end + format.api do if was_new_page render :action => 'show', :status => :created, :location => project_wiki_page_path(@project, @page.title) else render_api_ok end - } + end end else respond_to do |format| @@ -206,10 +206,10 @@ class WikiController < ApplicationController rescue ActiveRecord::StaleObjectError, Redmine::WikiFormatting::StaleSectionError # Optimistic locking exception respond_to do |format| - format.html { + format.html do flash.now[:error] = l(:notice_locking_conflict) render :action => 'edit' - } + end format.api { render_api_head :conflict } end end @@ -287,10 +287,10 @@ class WikiController < ApplicationController end @page.destroy respond_to do |format| - format.html { + format.html do flash[:notice] = l(:notice_successful_delete) redirect_to project_wiki_index_path(@project) - } + end format.api { render_api_ok } end end @@ -312,13 +312,13 @@ class WikiController < ApplicationController includes([:content, {:attachments => :author}]). to_a respond_to do |format| - format.html { + format.html do export = render_to_string :action => 'export_multiple', :layout => false send_data(export, :type => 'text/html', :filename => "wiki.html") - } - format.pdf { + end + format.pdf do send_file_headers! :type => 'application/pdf', :filename => "#{@project.identifier}.pdf" - } + end end end -- 2.39.5