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