# class ThemesController

### Public Instance Methods

create() click to toggle source

POST /themes POST /themes.json

    # File app/controllers/themes_controller.rb, line 42
    def create
      @theme = Theme.new(params[:theme])

      respond_to do |format|
        if @theme.save
          format.html { redirect_to @theme, notice: 'Theme was successfully created.' }
          format.json { render json: @theme, status: :created, location: @theme }
        else
          format.html { render action: "new" }
          format.json { render json: @theme.errors, status: :unprocessable_entity }
        end
      end
    end

destroy() click to toggle source

DELETE /themes/1 DELETE /themes/1.json

    # File app/controllers/themes_controller.rb, line 74
    def destroy
      @theme = Theme.find(params[:id])
      @theme.destroy

      respond_to do |format|
        format.html { redirect_to themes_url }
        format.json { head :no_content }
      end
    end

edit() click to toggle source

GET /themes/1/edit

    # File app/controllers/themes_controller.rb, line 36
    def edit
      @theme = Theme.find(params[:id])
    end

index() click to toggle source

GET /themes GET /themes.json

    # File app/controllers/themes_controller.rb, line 4
    def index
      @themes = Theme.all

      respond_to do |format|
        format.html # index.html.erb

        format.json { render json: @themes }
      end
    end

new() click to toggle source

GET /themes/new GET /themes/new.json

    # File app/controllers/themes_controller.rb, line 26
    def new
      @theme = Theme.new

      respond_to do |format|
        format.html # new.html.erb

        format.json { render json: @theme }
      end
    end

show() click to toggle source

GET /themes/1 GET /themes/1.json

    # File app/controllers/themes_controller.rb, line 15
    def show
      @theme = Theme.find(params[:id])

      respond_to do |format|
        format.html # show.html.erb

        format.json { render json: @theme }
      end
    end

update() click to toggle source

PUT /themes/1 PUT /themes/1.json

    # File app/controllers/themes_controller.rb, line 58
    def update
      @theme = Theme.find(params[:id])

      respond_to do |format|
        if @theme.update_attributes(params[:theme])
          format.html { redirect_to @theme, notice: 'Theme was successfully updated.' }
          format.json { head :no_content }
        else
          format.html { render action: "edit" }
          format.json { render json: @theme.errors, status: :unprocessable_entity }
        end
      end
    end