Forum: Ruby on Rails Use of FCKEDITOR as normal text area

1d4d78bf072607d3522fe3ceae4b7a9e?d=identicon&s=25 keerthi priya (Guest)
on 2013-10-30 10:30
(Received via mailing list)
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
280b78a61a968391b7e07e912be102a8?d=identicon&s=25 Robert Walker (robert4723)
on 2013-10-30 14:01
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/Help...
1d4d78bf072607d3522fe3ceae4b7a9e?d=identicon&s=25 keerthi priya (Guest)
on 2013-10-30 18:22
(Received via mailing list)
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.
1d4d78bf072607d3522fe3ceae4b7a9e?d=identicon&s=25 keerthi priya (Guest)
on 2013-10-31 07:51
(Received via mailing list)
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


On Wed, Oct 30, 2013 at 10:51 PM, keerthi priya <
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.