Sha256: 194fcc3aede786d30bf6217a67701d3de702bf84fe945391b0179ccd21ff817e

Contents?: true

Size: 515 Bytes

Versions: 2

Compression:

Stored size: 515 Bytes

Contents

class StylesheetsController < ApplicationController
  def open
    stylesheet = get_stylesheet
    @style = stylesheet.body
  end
  
  def edit
    @stylesheet = get_stylesheet
  end
  
  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
  
  private
  
  def get_stylesheet
    Stylesheet.first
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sushifish-0.9.6 lib/generators/sushi/templates/stylesheets_controller.rb
sushifish-0.9.0 lib/generators/sushi/templates/stylesheets_controller.rb