12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'app/controllers/gemgento/subscribers_controller.rb', line 12
def create
@subscriber = Subscriber.create(subscriber_params)
respond_to do |format|
if @subscriber.save
format.html
format.js { render action: 'create', layout: false }
format.json { render json: { result: true, subscriber: @subscriber } }
else
format.html
format.js { render action: 'errors', layout: false }
format.json { render json: { result: false, errors: @subscriber.errors.full_messages } }
end
end
end
|