Class: StylesheetsController

Inherits:
ApplicationController show all
Defined in:
lib/generators/sushi/templates/stylesheets_controller.rb

Instance Method Summary collapse

Instance Method Details

#editObject



7
8
9
# File 'lib/generators/sushi/templates/stylesheets_controller.rb', line 7

def edit
  @stylesheet = get_stylesheet
end

#openObject



2
3
4
5
# File 'lib/generators/sushi/templates/stylesheets_controller.rb', line 2

def open
  stylesheet = get_stylesheet
  @style = stylesheet.body
end

#updateObject



11
12
13
14
15
16
17
18
19
20
# File 'lib/generators/sushi/templates/stylesheets_controller.rb', line 11

def update
  @stylesheet = get_stylesheet
  
  if @stylesheet.update_attributes(params[:stylesheet])
    redirect_to(edit_stylesheet_path, :notice => 'Stylesheet was successfully updated.')
  else
    render :action => "edit"
  end
    
end