Is there a config flag to suppress the newline at the end of every ERB ''%>'' tag, so it would not be necessary to type ''-%> each time? -- Posted via http://www.ruby-forum.com/.
Joshua Schairbaum
2006-Feb-20 15:13 UTC
[Rails] SHow do you suppress ERB newlines globally
On Monday, February 20, 2006, at 3:46 PM, Lindsay Boyd wrote:>Is there a config flag to suppress the newline at the end of every ERB >''%>'' tag, so it would not be necessary to type ''-%> each time? >You would include this line in your environment.rb file: ActionView::Base.erb_trim_mode = ''>'' -- Posted with http://DevLists.com. Sign up and save your time!
> You would include this line in your environment.rb file: > > ActionView::Base.erb_trim_mode = ''>''I''ve added this line and restarted the server. I get the following error: --- Rendering within layouts/users Rendering users/profile ERROR: compiling _run_html_users_profile RAISED compile error public/../config/../app/views/users/profile.rhtml:31: parse error, unexpected tSTRING_BEG, expecting kDO_COND or '':'' or ''\n'' or '';'' --- Line 31 is the first line of ERB ending in a ''%>'' tag to be rendered by the controller: 30: <% for @box in @boxes -%> 31: <%= render :partial => ''boxes/box_line'' %> 32: <% end -%> -- Posted via http://www.ruby-forum.com/.
Now you have to delete all those ''-'' characters throughout all your pages :) -- Kent --- http://www.datanoise.com On 2/20/06, Lindsay Boyd <lindsay.boyd@ntlworld.com> wrote:> > You would include this line in your environment.rb file: > > > > ActionView::Base.erb_trim_mode = ''>'' > > I''ve added this line and restarted the server. I get the following > error: > > --- > Rendering within layouts/users > Rendering users/profile > ERROR: compiling _run_html_users_profile RAISED compile error > public/../config/../app/views/users/profile.rhtml:31: parse error, > unexpected tSTRING_BEG, expecting kDO_COND or '':'' or ''\n'' or '';'' > --- > > Line 31 is the first line of ERB ending in a ''%>'' tag to be rendered by > the controller: > > 30: <% for @box in @boxes -%> > 31: <%= render :partial => ''boxes/box_line'' %> > 32: <% end -%> > > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >