mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-16 23:30:12 +01:00
Convert render :text to render :body
Co-Authored-By: Dan Rice <dnrce@users.noreply.github.com>
This commit is contained in:
parent
60ae4f6f5f
commit
5805c511bb
9 changed files with 20 additions and 20 deletions
|
|
@ -52,7 +52,7 @@ class ApplicationController < ActionController::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def render_failure message, status = 404
|
def render_failure message, status = 404
|
||||||
render :text => message, :status => status
|
render :body => message, :status => status
|
||||||
end
|
end
|
||||||
|
|
||||||
# Returns a count of next actions in the given context or project The result
|
# Returns a count of next actions in the given context or project The result
|
||||||
|
|
@ -147,7 +147,7 @@ class ApplicationController < ActionController::Base
|
||||||
|
|
||||||
def admin_login_required
|
def admin_login_required
|
||||||
unless User.find(session['user_id']).is_admin
|
unless User.find(session['user_id']).is_admin
|
||||||
render :text => t('errors.user_unauthorized'), :status => 401
|
render :body => t('errors.user_unauthorized'), :status => 401
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@ class ContextsController < ApplicationController
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html { render :text => 'Context not found', :status => 404 }
|
format.html { render :body => 'Context not found', :status => 404 }
|
||||||
format.xml { render :xml => '<error>Context not found</error>', :status => 404 }
|
format.xml { render :xml => '<error>Context not found</error>', :status => 404 }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -116,7 +116,7 @@ class ContextsController < ApplicationController
|
||||||
if @saved
|
if @saved
|
||||||
render :xml => @context.to_xml( :except => :user_id )
|
render :xml => @context.to_xml( :except => :user_id )
|
||||||
else
|
else
|
||||||
render :text => "Error on update: #{@context.errors.full_messages.inject("") {|v, e| v + e + " " }}", :status => 409
|
render :body => "Error on update: #{@context.errors.full_messages.inject("") {|v, e| v + e + " " }}", :status => 409
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
@ -142,7 +142,7 @@ class ContextsController < ApplicationController
|
||||||
@down_count = current_user.contexts.size
|
@down_count = current_user.contexts.size
|
||||||
update_state_counts
|
update_state_counts
|
||||||
end
|
end
|
||||||
format.xml { render :text => "Deleted context #{@context.name}" }
|
format.xml { render :body => "Deleted context #{@context.name}" }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -222,7 +222,7 @@ class ContextsController < ApplicationController
|
||||||
|
|
||||||
def render_autocomplete
|
def render_autocomplete
|
||||||
lambda do
|
lambda do
|
||||||
render :text => for_autocomplete(current_user.contexts, params[:term])
|
render :body => for_autocomplete(current_user.contexts, params[:term])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,14 +19,14 @@ class IntegrationsController < ApplicationController
|
||||||
|
|
||||||
def cloudmailin
|
def cloudmailin
|
||||||
if !verify_cloudmailin_signature
|
if !verify_cloudmailin_signature
|
||||||
render :text => "Message signature verification failed.", :status => 403
|
render :body => "Message signature verification failed.", :status => 403
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
if process_message(params[:message])
|
if process_message(params[:message])
|
||||||
render :text => 'success', :status => 200
|
render :body => 'success', :status => 200
|
||||||
else
|
else
|
||||||
render :text => "No user found or other error", :status => 404
|
render :body => "No user found or other error", :status => 404
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ class NotesController < ApplicationController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
format.html do
|
format.html do
|
||||||
render :text => 'unexpected request for html rendering'
|
render :body => 'unexpected request for html rendering'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ class PreferencesController < ApplicationController
|
||||||
|
|
||||||
def render_date_format
|
def render_date_format
|
||||||
format = params[:date_format]
|
format = params[:date_format]
|
||||||
render :text => l(Date.current, :format => format)
|
render :body => l(Date.current, :format => format)
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ class ProjectsController < ApplicationController
|
||||||
end
|
end
|
||||||
format.autocomplete do
|
format.autocomplete do
|
||||||
projects = current_user.projects.active + current_user.projects.hidden
|
projects = current_user.projects.active + current_user.projects.hidden
|
||||||
render :text => for_autocomplete(projects, params[:term])
|
render :body => for_autocomplete(projects, params[:term])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -237,7 +237,7 @@ class ProjectsController < ApplicationController
|
||||||
@projects = current_user.projects
|
@projects = current_user.projects
|
||||||
template = 'projects/update_project_name'
|
template = 'projects/update_project_name'
|
||||||
else
|
else
|
||||||
render :text => success_text || 'Success'
|
render :body => success_text || 'Success'
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
|
@ -252,7 +252,7 @@ class ProjectsController < ApplicationController
|
||||||
if @saved
|
if @saved
|
||||||
render :xml => @project.to_xml( :except => :user_id )
|
render :xml => @project.to_xml( :except => :user_id )
|
||||||
else
|
else
|
||||||
render :text => "Error on update: #{@project.errors.full_messages.inject("") {|v, e| v + e + " " }}", :status => 409
|
render :body => "Error on update: #{@project.errors.full_messages.inject("") {|v, e| v + e + " " }}", :status => 409
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
@ -274,7 +274,7 @@ class ProjectsController < ApplicationController
|
||||||
@down_count = current_user.projects.size
|
@down_count = current_user.projects.size
|
||||||
update_state_counts
|
update_state_counts
|
||||||
}
|
}
|
||||||
format.xml { render :text => "Deleted project #{@project.name}" }
|
format.xml { render :body => "Deleted project #{@project.name}" }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -544,7 +544,7 @@ class TodosController < ApplicationController
|
||||||
render
|
render
|
||||||
end
|
end
|
||||||
|
|
||||||
format.xml { render :text => '200 OK. Action deleted.', :status => 200 }
|
format.xml { render :body => '200 OK. Action deleted.', :status => 200 }
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -710,7 +710,7 @@ class TodosController < ApplicationController
|
||||||
tags_all = tags_all - tags_beginning
|
tags_all = tags_all - tags_beginning
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.autocomplete { render :text => for_autocomplete(tags_beginning+tags_all, params[:term]) }
|
format.autocomplete { render :body => for_autocomplete(tags_beginning+tags_all, params[:term]) }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -99,7 +99,7 @@ class UsersController < ApplicationController
|
||||||
end
|
end
|
||||||
format.xml do
|
format.xml do
|
||||||
unless current_user && current_user.is_admin
|
unless current_user && current_user.is_admin
|
||||||
render :text => "401 Unauthorized: Only admin users are allowed access to this function.", :status => 401
|
render :body => "401 Unauthorized: Only admin users are allowed access to this function.", :status => 401
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
unless check_create_user_params
|
unless check_create_user_params
|
||||||
|
|
@ -110,7 +110,7 @@ class UsersController < ApplicationController
|
||||||
user.password_confirmation = user_params[:password]
|
user.password_confirmation = user_params[:password]
|
||||||
saved = user.save
|
saved = user.save
|
||||||
unless user.new_record?
|
unless user.new_record?
|
||||||
render :text => t('users.user_created'), :status => 200
|
render :body => t('users.user_created'), :status => 200
|
||||||
else
|
else
|
||||||
render_failure user.errors.to_xml, 409
|
render_failure user.errors.to_xml, 409
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -206,7 +206,7 @@ module LoginSystem
|
||||||
|
|
||||||
def basic_auth_denied
|
def basic_auth_denied
|
||||||
response.headers["WWW-Authenticate"] = "Basic realm=\"'Tracks Login Required'\""
|
response.headers["WWW-Authenticate"] = "Basic realm=\"'Tracks Login Required'\""
|
||||||
render :text => t('login.unsuccessful'), :status => 401
|
render :body => t('login.unsuccessful'), :status => 401
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue