On 21 February 2011 08:51, khoan <huu.khoa.ngu...@gmail.com> wrote:
> <%= semantic_form_for @template do |f| %>
>  <%= f.input :source %>
> <% end %>
>
> where template is an instance of
>
> class Template < ActiveRecord::Base
>  # add_column :templates, :source, :text
> end

Please don't top post, it makes it difficult to follow the thread.
Insert your reply into the previous post.  Thanks.

And what html does that generate (open it in the browser and use View
> Page Source or similar to view the html, then copy the relevant
section and paste it here)?

Colin

>
> On Feb 20, 8:19 pm, Colin Law <clan...@googlemail.com> wrote:
>> On 20 February 2011 08:39, khoan <huu.khoa.ngu...@gmail.com> wrote:
>>
>> > The app is using formtastic to generate the textarea. I've watered it
>> > down to the barebone code provided in the first post.
>>
>> How are you giving formtastic the initial text for the textarea?  Can
>> you show the code you use for that?
>>
>> Please don't top post, it makes it difficult to follow the thread.
>> Insert your reply into the previous post.  Thanks.
>>
>> Colin
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> > If we can unindent the <%= render 'unindent' %> to align with <html>,
>> > then we have a winner. So far I fathom that this is not possible. Work
>> > around would be to apply some js solution on the <textarea> to keep
>> > the formatting we want.
>>
>> > On Feb 19, 8:59 pm, Colin Law <clan...@googlemail.com> wrote:
>> >> On 19 February 2011 09:30, khoan <huu.khoa.ngu...@gmail.com> wrote:
>>
>> >> > <html>
>> >> > <body>
>> >> > <textarea>if indent then
>> >> > __indent
>> >> > end</textarea>
>>
>> >> > __<textarea>if indent then
>> >> > __indent
>> >> > end</textarea>
>>
>> >> > </body>
>> >> > </html>
>>
>> >> > When viewed in the browser:
>>
>> >> > the first <textarea> appears as and will be saved as thus:
>>
>> >> > if indent then
>> >> > __indent
>> >> > end
>>
>> >> > similarly, 2nd <textarea> appears as and will be saved as thus:
>>
>> >> > __if indent then
>> >> > ____indent
>> >> > __end
>>
>> >> OK, that is not the problem you originally asked.  From your first
>> >> message you have
>> >> <textarea><%= 'this is unindented' %></textarea>
>> >> which is not the above situation at all.
>>
>> >> Can you show me the erb you are using to generate the problem code you
>> >> are now showing?
>>
>> >> Colin
>>
>> > --
>> > You received this message because you are subscribed to the Google Groups 
>> > "Ruby on Rails: Talk" group.
>> > To post to this group, send email to rubyonrails-talk@googlegroups.com.
>> > To unsubscribe from this group, send email to 
>> > rubyonrails-talk+unsubscr...@googlegroups.com.
>> > For more options, visit this group 
>> > athttp://groups.google.com/group/rubyonrails-talk?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To unsubscribe from this group, send email to 
> rubyonrails-talk+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to