Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class ThemesController < ApplicationController
- def index
- @themes = Theme.all
- end
- def show
- @theme = Theme.find(params[:id])
- end
- def new
- @theme = Theme.new
- end
- def create
- @theme = Theme.new(params[:theme])
- if @theme.save
- redirect_to @theme, :notice => "Successfully created theme."
- else
- render :action => 'new'
- end
- end
- def edit
- @theme = Theme.find(params[:id])
- end
- def update
- @theme = Theme.find(params[:id])
- if @theme.update_attributes(params[:theme])
- redirect_to @theme, :notice => "Successfully updated theme #{@theme.name}."
- else
- render :action => 'edit'
- end
- end
- def destroy
- @theme = Theme.find(params[:id])
- @theme.destroy
- redirect_to themes_url, :notice => "Successfully destroyed theme."
- end
- end
Add Comment
Please, Sign In to add comment