Class: RedactorRails::BaseController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- RedactorRails::BaseController
show all
- Defined in:
- app/controller/redactor_rails/base_controller.rb
Instance Method Summary
collapse
Instance Method Details
#create ⇒ Object
8
9
10
11
12
13
14
15
16
17
18
19
|
# File 'app/controller/redactor_rails/base_controller.rb', line 8
def create
@redactor = controller_model.new
file = params[:file]
@redactor.data = RedactorRails::Http.normalize_param(file, request)
if @redactor.save
render text: { filelink: @redactor.url }.to_json
else
render nothing: true
end
end
|
#index ⇒ Object
3
4
5
6
|
# File 'app/controller/redactor_rails/base_controller.rb', line 3
def index
@redactors = controller_model.order :id
render json: @redactors.to_json
end
|