Sha256: f7ceed3af7344706a7bae8f90591658c018f4ab3d5138e58e45cd43024ff6eb0
Contents?: true
Size: 802 Bytes
Versions: 5
Compression:
Stored size: 802 Bytes
Contents
class CssController < ApplicationController before_filter :auth_required, :except => :getstyle def getstyle style = User.find(@params['id']).stylesheet.data rescue nil render_text('', 404) and return unless style response.headers['Content-type'] = 'text/css' render_text style end def index edit render_action 'edit' end def edit @lastpost = current_user.last_post @stylesheet = current_user.stylesheet || current_user.build_stylesheet end def update @stylesheet = current_user.stylesheet || current_user.build_stylesheet @stylesheet.data = @params['stylesheet']['data'] if @stylesheet.save flash['notice'] = 'Stylesheet was successfully updated.' redirect_to_my_home else render_action 'edit' end end end
Version data entries
5 entries across 5 versions & 1 rubygems