WYSIWYG Editor not saving proper data

178 views
Skip to first unread message

Joy Ganguly

unread,
Apr 28, 2014, 8:35:29 AM4/28/14
to rubyonra...@googlegroups.com
i am using wysiwyg editor (https://github.com/schnawel007/bootstrap3-wysihtml5) within form, but when submitting the form the data with the html tags is not saved rather saving the data in plain text, also searched google but not getting any possible solution

Hassan Schroeder

unread,
Apr 28, 2014, 10:22:07 AM4/28/14
to rubyonrails-talk
On Mon, Apr 28, 2014 at 5:35 AM, Joy Ganguly <tech.tu...@gmail.com> wrote:
> i am using wysiwyg editor
> (https://github.com/schnawel007/bootstrap3-wysihtml5) within form, but when
> submitting the form the data with the html tags is not saved

The editor doesn't "save" anything - your code does.

Does the form submission event in your logs show the html? Then
the editor has done its job.

What do you see when you examine the saved data in the db?

--
Hassan Schroeder ------------------------ hassan.s...@gmail.com
http://about.me/hassanschroeder
twitter: @hassan

Joy Ganguly

unread,
Apr 28, 2014, 11:32:50 AM4/28/14
to rubyonra...@googlegroups.com
Hi buddy!

Thanks a lot for replying.

But the parameters in the log also not showing the html and it is

 Parameters: {"utf8"=>"✓", "authenticity_token"=>"P7fHbeUQlcCaV3MK2g+Qu6h/CmhM8+g6SOHzqjEuoPI=", "request"=>{"title"=>"Title", "date"=>"2014/4/30", "time"=>"4:15 PM", "desc"=>"Bold"}, "_wysihtml5_mode"=>"1", "commit"=>"Add Request"}

When i examine the saved data in db it is just plain text.

Colin Law

unread,
Apr 28, 2014, 11:39:25 AM4/28/14
to rubyonra...@googlegroups.com
On 28 April 2014 16:32, Joy Ganguly <tech.tu...@gmail.com> wrote:
> Hi buddy!
>
> Thanks a lot for replying.
>
> But the parameters in the log also not showing the html and it is
>
> Parameters: {"utf8"=>"✓",
> "authenticity_token"=>"P7fHbeUQlcCaV3MK2g+Qu6h/CmhM8+g6SOHzqjEuoPI=",
> "request"=>{"title"=>"Title", "date"=>"2014/4/30", "time"=>"4:15 PM",
> "desc"=>"Bold"}, "_wysihtml5_mode"=>"1", "commit"=>"Add Request"}
>
> When i examine the saved data in db it is just plain text.

Do you mean the html tags appear in the data, but as text rather than
being interpreted as html, or the html tags are not there at all, but
the text you entered is there? Just to make sure there is no
understanding you could copy one of the records here.

Colin

>
> On Monday, 28 April 2014 19:52:07 UTC+5:30, Hassan Schroeder wrote:
>>
>> On Mon, Apr 28, 2014 at 5:35 AM, Joy Ganguly <tech.tu...@gmail.com> wrote:
>> > i am using wysiwyg editor
>> > (https://github.com/schnawel007/bootstrap3-wysihtml5) within form, but
>> > when
>> > submitting the form the data with the html tags is not saved
>>
>> The editor doesn't "save" anything - your code does.
>>
>> Does the form submission event in your logs show the html? Then
>> the editor has done its job.
>>
>> What do you see when you examine the saved data in the db?
>>
>> --
>> Hassan Schroeder ------------------------ hassan.s...@gmail.com
>> http://about.me/hassanschroeder
>> twitter: @hassan
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to rubyonrails-ta...@googlegroups.com.
> To post to this group, send email to rubyonra...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/rubyonrails-talk/efda6a7a-b8e3-4cbd-b563-0c4fccd08343%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.

Hassan Schroeder

unread,
Apr 28, 2014, 11:42:05 AM4/28/14
to rubyonrails-talk
On Mon, Apr 28, 2014 at 8:32 AM, Joy Ganguly <tech.tu...@gmail.com> wrote:

> Parameters: {"utf8"=>"✓",
> "authenticity_token"=>"P7fHbeUQlcCaV3MK2g+Qu6h/CmhM8+g6SOHzqjEuoPI=",
> "request"=>{"title"=>"Title", "date"=>"2014/4/30", "time"=>"4:15 PM",
> "desc"=>"Bold"}, "_wysihtml5_mode"=>"1", "commit"=>"Add Request"}

What field is supposed to have markup in it?

In any case, if markup is not being submitted as you expect, you'll
need to make sure your page markup is valid, there's no JavaScript
errors, and the configuration for this plugin is correct, assuming there
is some (I've never used it).

Worst case I'd create a minimal test project to see if you could get it
to work at all. If that doesn't work, send the link to it.

Joy Ganguly

unread,
Apr 29, 2014, 3:39:36 PM4/29/14
to rubyonra...@googlegroups.com
Hassan Schroeder:

The field "desc" should contain "<b>Bold</b>" rather than
"desc"=>"Bold". I have checked the markup and javascript but there is no problem.

Colin Law:

There is no html tag at all only the plain text.

Scott Ribe

unread,
Apr 29, 2014, 4:10:17 PM4/29/14
to rubyonra...@googlegroups.com
On Apr 29, 2014, at 1:39 PM, Joy Ganguly <tech.tu...@gmail.com> wrote:

> The field "desc" should contain "<b>Bold</b>" rather than "desc"=>"Bold". I have checked the markup and javascript but there is no problem.

If it's not being submitted to the server, then there is a problem with the markup or javascript. Quickest thing to do is use your browser debugging tools to see what the browser is actually sending to the server. Then you'll at least know whether the tags are stripped in the browser or the server.

--
Scott Ribe
scott...@elevated-dev.com
http://www.elevated-dev.com/
(303) 722-0567 voice




Hassan Schroeder

unread,
Apr 29, 2014, 4:54:55 PM4/29/14
to rubyonrails-talk
On Tue, Apr 29, 2014 at 12:39 PM, Joy Ganguly <tech.tu...@gmail.com> wrote:

> The field "desc" should contain "<b>Bold</b>" rather than "desc"=>"Bold". I
> have checked the markup and javascript but there is no problem.

I just set up a quick testbed to try this editor, and my opinion is that
it doesn't work, period -- formatted text is created in the browser but
not sent to the server on submit.

Bummer because it does have an attractive UI, but I just don't have
the time today to debug the problem.

Definitely not a Rails issue, though.

Pratap Patil

unread,
May 7, 2014, 10:02:57 AM5/7/14
to rubyonra...@googlegroups.com
Hi guys .
   
 We need check datatype we  mention when create database for this field , we require datatype for field is text , then data will save in our database.

Scott Ribe

unread,
May 7, 2014, 10:20:30 AM5/7/14
to rubyonra...@googlegroups.com
On May 7, 2014, at 8:02 AM, Pratap Patil <prat...@gmail.com> wrote:

> We need check datatype we mention when create database for this field , we require datatype for field is text , then data will save in our database.

???

If the correct data is not being submitted by the browser to the client, then it's not going to matter what the data type in the database is. (And of course it should be text, what other option is there.)

Until you determine what data the client is actually submitting to the server, you're just running around in circles wasting your time (and ours a bit too).
Reply all
Reply to author
Forward
0 new messages