Some cleaning up, for rubocop
This commit is contained in:
parent
ad01be89c4
commit
4002695e5d
@ -36,10 +36,9 @@ class EventsController < ApplicationController
|
||||
respond_to do |format|
|
||||
if @event.save
|
||||
format.html { redirect_to :root, notice: t('.ok') }
|
||||
# 201 means :created
|
||||
format.json { render action: 'show', status: 201, location: @event }
|
||||
format.json { render action: :show, status: :created, location: @event }
|
||||
else
|
||||
format.html { render action: 'new' }
|
||||
format.html { render action: :new }
|
||||
status = :unprocessable_entity
|
||||
format.json { render json: @event.errors, status: status }
|
||||
end
|
||||
@ -63,7 +62,7 @@ class EventsController < ApplicationController
|
||||
format.html { redirect_to @event, notice: t('.ok') }
|
||||
format.json { head :no_content }
|
||||
else
|
||||
format.html { render action: 'edit' }
|
||||
format.html { render action: :edit }
|
||||
status = :unprocessable_entity
|
||||
format.json { render json: @event.errors, status: status }
|
||||
end
|
||||
|
@ -27,8 +27,7 @@ class OrgasController < ApplicationController
|
||||
respond_to do |format|
|
||||
if @orga.save
|
||||
format.html { redirect_to @orga, notice: t('.ok') }
|
||||
# 201 means :created
|
||||
format.json { render action: 'show', status: 201, location: @orga }
|
||||
format.json { render action: 'show', status: :created, location: @orga }
|
||||
else
|
||||
format.html { render action: 'new' }
|
||||
format.json { render json: @orga.errors, status: :unprocessable_entity }
|
||||
|
@ -30,14 +30,14 @@
|
||||
= f.label :address
|
||||
= f.text_field :address, list: :addresses
|
||||
%datalist#addresses
|
||||
- Event.where('address is not null').group(:address).order('count(address) desc').pluck(:address).each do |address|
|
||||
%option= address
|
||||
- Event.where('address is not null').group(:address).order('1 desc').count.each do |r|
|
||||
%option= r[0]
|
||||
.field.city.required
|
||||
= f.label :city
|
||||
= f.text_field :city, required: true, list: :cities
|
||||
%datalist#cities
|
||||
- Event.group(:city).order('count(city) desc').pluck(:city).each do |city|
|
||||
%option= city
|
||||
- Event.group(:city).order('1 desc').count.each do |r|
|
||||
%option= r[0]
|
||||
.field.region.required
|
||||
= f.label :region
|
||||
= render partial: '/regions/selector', locals: { f: f }
|
||||
|
Loading…
Reference in New Issue
Block a user