Use of FCKEDITOR as normal text area

18 views
Skip to first unread message

keerthi priya

unread,
Oct 30, 2013, 5:29:05 AM10/30/13
to rubyonra...@googlegroups.com
Hi all

I am trying to use Fckeditor as text area to send mails.here is my code
<% remote_form_for :send_sms,
        :before => "Element.show('loader')",
        :success => "Element.hide('loader')" do |sms| %>
<div id="news_content_text_field_bg">
<%= fckeditor_textarea :send_sms, :message,:lang => I18n.locale,:langdir => (rtl? ? 'rtl' : 'ltr') %></div>
<%= submit_tag "#{t('send_sms')}",:class=>'submit_button' %>

<% end %>

But here as the form name is send_sms I used the same name for fckeditor I am unable to send params to my controller.I got the error like
uninitialized constant SendSms.

Can someone help me what is going wrong.


Thanks in advance

Robert Walker

unread,
Oct 30, 2013, 9:01:50 AM10/30/13
to rubyonra...@googlegroups.com
keerthi priya wrote in post #1126074:
> Hi all
>
> I am trying to use Fckeditor as text area to send mails.here is my code
> <% remote_form_for :send_sms,
> :before => "Element.show('loader')",
> :success => "Element.hide('loader')" do |sms| %>
> <div id="news_content_text_field_bg">
> <%= fckeditor_textarea :send_sms, :message,:lang => I18n.locale,:langdir
> =>
> (rtl? ? 'rtl' : 'ltr') %></div>
> <%= submit_tag "#{t('send_sms')}",:class=>'submit_button' %>
>
> <% end %>
>
> But here as the form name is send_sms I used the same name for fckeditor

In your code :send_sms is not the form name. It is the name of the model
that remote_form_for expect to interact with.

> I
> am unable to send params to my controller.I got the error like
>
> uninitialized constant SendSms.

You getting this error because there is no model object class named
SendSms.

> Can someone help me what is going wrong.

The Rails documentation can help you. I have linked to the Rails 4
documentation describing form_for. Rails 4 removed remote_form_for and
instead added the remote functionality to form_for as you can see later
in the docs:

http://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html#method-i-form_for

--
Posted via http://www.ruby-forum.com/.

keerthi priya

unread,
Oct 30, 2013, 1:21:42 PM10/30/13
to rubyonra...@googlegroups.com
Thanks Robert Walker for response. Well send_sms is the form name only but fckeditor is expecting only models. It is not considering any of the name like

There is a model like student fckeditor works fine with below line

<%= fckeditor_textarea :student, :message,:lang => I18n.locale,:langdir => (rtl? ? 'rtl' : 'ltr') %>

as there is student model and there is no send_sms model I have issue in view but in spite of give the model name to fckeditor in controller which what that value or the text from fckeditor  in this way params[:student][:message] I do  not get any value in controller. This is what I am facing it.
There is another text box
<%= text_field :send_sms,:subject,:placeholder => 'Subject'%>
and when I access params[:send_sms][:subject] I get my params here but not with fckeditor as it expects model name first in place of send_sms but after giving the any model name I can not access my params.



--
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/04c6c7e56043a236852af1688f4d0a63%40ruby-forum.com.

keerthi priya

unread,
Oct 31, 2013, 2:50:14 AM10/31/13
to rubyonra...@googlegroups.com
I have solved my issue of params I have give model name which it was expecting it. I can get the params but when I mail was sent from fckeditor I am getting the text with html tags in my mail what to do?

Kindly help me
Reply all
Reply to author
Forward
0 new messages