class FileSystemsController
typed: false
Public Instance Methods
create()
click to toggle source
POST /file_systems POST /file_systems.json
# File server/redux-os/app/controllers/file_systems_controller.rb, line 27 def create @file_system = FileSystem.new(file_system_params) respond_to do |format| if @file_system.save format.html { redirect_to @file_system, notice: 'File system was successfully created.' } format.json { render :show, status: :created, location: @file_system } else format.html { render :new } format.json { render json: @file_system.errors, status: :unprocessable_entity } end end end
destroy()
click to toggle source
DELETE /file_systems/1 DELETE /file_systems/1.json
# File server/redux-os/app/controllers/file_systems_controller.rb, line 57 def destroy @file_system.destroy respond_to do |format| format.html { redirect_to file_systems_url, notice: 'File system was successfully destroyed.' } format.json { head :no_content } end end
edit()
click to toggle source
GET /file_systems/1/edit
# File server/redux-os/app/controllers/file_systems_controller.rb, line 22 def edit end
index()
click to toggle source
GET /file_systems GET /file_systems.json
# File server/redux-os/app/controllers/file_systems_controller.rb, line 7 def index @file_systems = FileSystem.all end
new()
click to toggle source
GET /file_systems/new
# File server/redux-os/app/controllers/file_systems_controller.rb, line 17 def new @file_system = FileSystem.new end
show()
click to toggle source
GET /file_systems/1 GET /file_systems/1.json
# File server/redux-os/app/controllers/file_systems_controller.rb, line 13 def show end
update()
click to toggle source
PATCH/PUT /file_systems/1 PATCH/PUT /file_systems/1.json
# File server/redux-os/app/controllers/file_systems_controller.rb, line 43 def update respond_to do |format| if @file_system.update(file_system_params) format.html { redirect_to @file_system, notice: 'File system was successfully updated.' } format.json { render :show, status: :ok, location: @file_system } else format.html { render :edit } format.json { render json: @file_system.errors, status: :unprocessable_entity } end end end
Private Instance Methods
file_system_params()
click to toggle source
Never trust parameters from the scary internet, only allow the white list through.
# File server/redux-os/app/controllers/file_systems_controller.rb, line 72 def file_system_params params.require(:file_system).permit(:description, :machine_readable_identifier) end
set_file_system()
click to toggle source
Use callbacks to share common setup or constraints between actions.
# File server/redux-os/app/controllers/file_systems_controller.rb, line 67 def set_file_system @file_system = FileSystem.find(params[:id]) end