File tree Expand file tree Collapse file tree 2 files changed +15
-10
lines changed
Expand file tree Collapse file tree 2 files changed +15
-10
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -26,7 +26,6 @@ def self.testing_string
2626
2727 post "/*" do
2828 if params [ "page" ]
29- puts params
3029 @css = params [ "page" ] [ "css" ]
3130 css_to_sass ( params [ "commit" ] )
3231
@@ -44,20 +43,16 @@ def css_to_sass(type={})
4443 if type . eql? ( "Convert 2 SCSS" )
4544 if convert_to_scss ( @css ) . class == String
4645 @sass = convert_to_scss ( @css )
47- flash [ :error ] = '' # TODO: Fix this shit!
48- flash [ :success ] = 'Creativity is a habit.'
46+ flash_notice
4947 else
50- flash [ :success ] = '' # TODO: Same crap!
51- flash [ :error ] = "Dude, nasty error! - #{ @error } "
48+ flash_error
5249 end
5350 else
5451 if convert_to_sass ( @css ) . class == String
5552 @sass = convert_to_sass ( @css )
56- flash [ :error ] = ''
57- flash [ :success ] = 'Creativity is a habit.'
53+ flash_notice
5854 else
59- flash [ :success ] = ''
60- flash [ :error ] = "Dude, nasty error! - #{ @error } "
55+ flash_error
6156 end
6257 end
6358 end
@@ -91,4 +86,15 @@ def to_xml
9186 end
9287 end
9388 end
89+
90+ def flash_notice
91+ flash [ :error ] = ''
92+ flash [ :success ] = 'Creativity is a habit.'
93+ end
94+
95+ def flash_error
96+ flash [ :success ] = ''
97+ flash [ :error ] = "Dude, nasty error! - #{ @error } "
98+ end
99+
94100end
You can’t perform that action at this time.
0 commit comments