I think the compilation step in my app is not the problem here, because I 
turned it off and am still getting the same behavior

Just to be clear, it is saving as this:

2.1.5 :003 > b.style_source
 => "background-image: url('[IMAGE-PATH:1]')\r\nbackground-size: 
100%\r\nheight: 63vw\r\nbackground-repeat: no-repeat" 


but then it displays funny. Am I correct in concluding that \r\n is what I 
should be seeing here? I always understood that to be the correct universal way 
to store linebreaks, in accordance with the Unix standard, and 
backward-compatible on Windows.  Am I wrong about that perhaps?

I will try this out in a test app to see if I can reproduce.

-Jason




> On Mar 27, 2015, at 4:32 AM, Sergio Cambra <[email protected]> wrote:
> 
> I see in the gist that you send style_source and you write in style_compiled, 
> can some spaces be inserting in the compilation process?
>  
> El Jueves, 26 de marzo de 2015 15:58:20 Jason Fleetwood-Boldt escribió:
> > Yes, this is exactly correct as you say in the database I am seeing \r\n and
> > that is the problem
> > 
> > Now, my question is of course the reverse, how can I fix it so that the \r
> > characters aren't inserted into the DB in the first place.
> > 
> > I did a little digging an it appears that these are submitted by the browser
> > (seems odd to me):
> > 
> > https://gist.github.com/anonymous/915fcecc1abb66187b40
> > 
> > 
> > -Jason
> > 
> > 
> > 
> > 2.1.5 :010 > b.style_source
> >  => "background-image: url('[IMAGE-PATH:1]')\r\nbackground-size:
> > 100%\r\nheight: 63vw\r\nbackground-repeat: no-repeat"
> > > On Mar 12, 2015, at 5:10 AM, Sergio Cambra <[email protected]> wrote:
> > > 
> > > Can you check rails log for these spaces? Maybe \r\n are send and \r
> > > converted to spaces. It's weird but it's only I can think.
> > > 
> > > El Miércoles, 11 de marzo de 2015 14:04:14 Jason Fleetwood-Boldt escribió:
> > >> Active Scaffold list,
> > >> 
> > >> I'm seeing something odd with a :textarea output form-- I seem to be
> > >> getting extra spaces inserted before each new line in my text, anyone
> > >> seen this before?
> > >> 
> > >> 
> > >> In my case, I have a field that holds HTML, and when I save it like so:
> > >> 
> > >> <div style="background: url('http://example.com/image.jpg') no-repeat;
> > >> width: 100%; position: fixed; background-size: 100%; z-index: -1; height:
> > >> 710px;"></div> <div>
> > >> <div class=' row' style="border: solid 1px green;">
> > >> </div>
> > >> <div class="col-md-12" style="position: relative; height: 40vw;  ">
> > >> </div>
> > >> <div>
> > >> 
> > >> The result I get in the database is:
> > >> 
> > >> <div style="background: url('http://example.com/image.jpg') no-repeat;
> > >> width: 100%; position: fixed; background-size: 100%; z-index: -1; height:
> > >> 710px;"></div> <div>
> > >> 
> > >>  <div class=' row' style="border: solid 1px green;">
> > >>  </div>
> > >>  <div class="col-md-12" style="position: relative; height: 40vw;  ">
> > >>  </div>
> > >>  <div>
> > >> 
> > >> As I keep clicking "Update" on the same record, it keeps inserting spaces
> > >> on every line except the first line.
> > >> 
> > >> My controller has is configured as such:
> > >>   config.actions = [:create, :list,  :update, :show, :field_search]
> > >>   
> > >>   config.update.columns = [:name,  :component_type,  :locked,
> > >> :
> > >> :content_strategy,   :content_source , ... ] (not all columns shown for
> > >> 
> > >> brevity)
> > >> 
> > >>   config.columns[:content_source].form_ui = :textarea
> > >> 
> > >> Anyone seen anything like this before? I am on Active Scaffold 3.4.17
> > >> with
> > >> Rails 4.0.13
> > >> 
> > >> -Jason
> > >> 
> > >> 
> > >> 
> > >> 
> > >> ----
> > >> 
> > >> Jason Fleetwood-Boldt
> > >> [email protected]
> > >> http://www.jasonfleetwoodboldt.com/writing
> > 
> > ----
> > 
> > Jason Fleetwood-Boldt
> > [email protected]
> > http://www.jasonfleetwoodboldt.com/writing
>  
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "ActiveScaffold : Ruby on Rails Gem" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/activescaffold.
> For more options, visit https://groups.google.com/d/optout.

----

Jason Fleetwood-Boldt
[email protected]
http://www.jasonfleetwoodboldt.com/writing

-- 
You received this message because you are subscribed to the Google Groups 
"ActiveScaffold : Ruby on Rails Gem" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/activescaffold.
For more options, visit https://groups.google.com/d/optout.

Reply via email to