Hello, I''m trying to use Nicedit to improve my text_areas in some views of my project. I have installed jquery: ruby script/plugin install git://github.com/aaronchi/jrails.git nicEdit plugin: ruby script/plugin install git://github.com/sergio-fry/Simple-nicEdit.git Add js in layout: <%= javascript_include_tag ''nicEdit'', ''nicEditInit'' %> Use it in form <% form_for @item do |f| %> <%= f.rich_text_area :description %> <% end %> I have no results in my views and no javascript errors appears (checked with firebug). Could someone tell me if I have skipped something? Could someone recommend me other plugin or gem for this purpose? Thanks -- Posted via http://www.ruby-forum.com/. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 5 January 2011 10:21, Daniel Oton <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Hello, I''m trying to use Nicedit to improve my text_areas in some views > of my project. > > I have installed jquery: > ruby script/plugin install git://github.com/aaronchi/jrails.git > > nicEdit plugin: > ruby script/plugin install > git://github.com/sergio-fry/Simple-nicEdit.git > > Add js in layout: > <%= javascript_include_tag ''nicEdit'', ''nicEditInit'' %> > > Use it in form > <% form_for @item do |f| %>That should be <%= form_for... I would have thought that looking at the html of the page (View > Source in the browser) it would have been clear that this was not generating anything. Colin> <%= f.rich_text_area :description %> > <% end %> > > I have no results in my views and no javascript errors appears (checked > with firebug).-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Thanks for your response. If I use <%= form_for... It breaks ActionView::TemplateError (compile error /home/fydserve/intraweb/app/views/items/new.html.erb:5: syntax error, unexpected '')'' ...(( form_for(@item) do |f| ).to_s); @output_buffer.concat ... ^ /home/fydserve/intraweb/app/views/items/new.html.erb:28: syntax error, unexpected kENSURE, expecting '')'' /home/fydserve/intraweb/app/views/items/new.html.erb:30: syntax error, unexpected kEND, expecting '')'') on line #5 of app/views/items/new.html.erb: View Code: <%= form_for(@noticia) do |f| %> <%= f.error_messages %> <p><%= f.label :title %><br /><%= f.text_field :title %></p> <p><%= f.label :description %><br /><%= f.rich_text_area :description %></p> <p><%= f.submit ''Create'' %></p> <% end %> HTML generated: It generates the script and atributte class="simple_nicedit" in textarea, but the view is showing normal textarea. <script src="/javascripts/nicEdit.js?1294182055" type="text/javascript"></script> <script src="/javascripts/nicEditInit.js?1294182055" type="text/javascript"></script> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> ... </head> <body> <form action="/items" class="new_item" id="new_item" method="post"><div style="margin:0;padding:0;display:inline"><input name="authenticity_token" type="hidden" value="FCnWc8Q8vcadwBSnlhENQpmDjAECikKAK9ecOtFzjoI=" /></div> <p> <label for="item_title">Title</label><br /> <input id="item_title" name="item[title]" size="30" type="text" /> </p> <p> <label for="item_description">Description</label><br /> <textarea class=" simple_nicedit" cols="40" id="item_description" name="item[description]" rows="20"></textarea> </p> <p> <input id="item_submit" name="commit" type="submit" value="Create" /> </p> </form> </body> </html> thanks -- Posted via http://www.ruby-forum.com/. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 5 January 2011 11:04, Daniel Oton <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Thanks for your response. > > If I use <%= form_for... It breaks > ActionView::TemplateError (compile error > /home/fydserve/intraweb/app/views/items/new.html.erb:5: syntax error, > unexpected '')'' > ...(( form_for(@item) do |f| ).to_s); @output_buffer.concat ... > ^ > /home/fydserve/intraweb/app/views/items/new.html.erb:28: syntax error, > unexpected kENSURE, expecting '')'' > /home/fydserve/intraweb/app/views/items/new.html.erb:30: syntax error, > unexpected kEND, expecting '')'') on line #5 of > app/views/items/new.html.erb: > > View Code: > > <%= form_for(@noticia) do |f| %>I don''t understand, the error above shows form_for(@item) so this would not appear to be the code generating the error.> <%= f.error_messages %> > <p><%= f.label :title %><br /><%= f.text_field :title %></p> > <p><%= f.label :description %><br /><%= f.rich_text_area :description > %></p> > <p><%= f.submit ''Create'' %></p> > <% end %> > > HTML generated: It generates the script and atributte > class="simple_nicedit" in textarea, but the view is showing normal > textarea.How is it generating html if you get a compile error? Colin> > <script src="/javascripts/nicEdit.js?1294182055" > type="text/javascript"></script> > <script src="/javascripts/nicEditInit.js?1294182055" > type="text/javascript"></script> > > <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> > <head> > ... > </head> > <body> > > <form action="/items" class="new_item" id="new_item" method="post"><div > style="margin:0;padding:0;display:inline"><input > name="authenticity_token" type="hidden" > value="FCnWc8Q8vcadwBSnlhENQpmDjAECikKAK9ecOtFzjoI=" /></div> > <p> > <label for="item_title">Title</label><br /> > <input id="item_title" name="item[title]" size="30" type="text" /> > </p> > <p> > <label for="item_description">Description</label><br /> > <textarea class=" simple_nicedit" cols="40" id="item_description" > name="item[description]" rows="20"></textarea> > </p> > <p> > <input id="item_submit" name="commit" type="submit" value="Create" > /> > </p> > </form> > </body> > </html> > > thanks > > -- > Posted via http://www.ruby-forum.com/. > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
I tried withe <%= form_form, as you told me, and I have compile error (and nothing else of course) If I use <% form_form, I have no compilation error and the html code. Thanks -- Posted via http://www.ruby-forum.com/. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 5 January 2011 11:25, Daniel Oton <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> I tried withe <%= form_form, as you told me, and I have compile error > (and nothing else of course)Please quote the previous reply so the thread is easier to understand.> > If I use <% form_form, I have no compilation error and the html code.But the example you showed that did not error has <%= Quoting from previous post:> <%= form_for(@noticia) do |f| %> > <%= f.error_messages %> > <p><%= f.label :title %><br /><%= f.text_field :title %></p> > <p><%= f.label :description %><br /><%= f.rich_text_area :description > %></p> > <p><%= f.submit ''Create'' %></p> > <% end %>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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
I pasted the wrong code... Sorry. It should be: View Code: <%= form_for(@item) do |f| %> <%= f.error_messages %> <p><%= f.label :title %><br /><%= f.text_field :title %></p> <p><%= f.label :description %><br /><%= f.rich_text_area :description %></p> <p><%= f.submit ''Create'' %></p> <% end %> -- Posted via http://www.ruby-forum.com/. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
I pasted the wrong code... Sorry. It should be: View Code: <% form_for(@item) do |f| %> <%= f.error_messages %> <p><%= f.label :title %><br /><%= f.text_field :title %></p> <p><%= f.label :description %><br /><%= f.rich_text_area :description %></p> <p><%= f.submit ''Create'' %></p> <% end %> -- Posted via http://www.ruby-forum.com/. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
I don''t know if I understood you correctly... Any idea? Thanks -- Posted via http://www.ruby-forum.com/. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 5 January 2011 11:53, Daniel Oton <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: As I asked before, please include the appropriate bits of the previous post in your message so that it makes sense. As it stands this message will now make no sense to someone finding the thread in the future.> I pasted the wrong code... Sorry. > > It should be: > > View Code: > > <% form_for(@item) do |f| %>It *must* be <%= form_for otherwise it will not work. If you cannot get this to compile then that is the problem to find the solution to first. 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Finally, I have used tinyMCE using the following link: https://github.com/kete/tiny_mce It has a gem version too! :-) Thanks! -- Posted via http://www.ruby-forum.com/. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 5 January 2011 13:40, Daniel Oton <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Finally, I have used tinyMCE using the following link: > https://github.com/kete/tiny_mce > > It has a gem version too! :-)Did you find that <%= form_for is now working for you? 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
> As I asked before, please include the appropriate bits of the previous > post in your message so that it makes sense. As it stands this > message will now make no sense to someone finding the thread in the > future.Ok, I didn''t know what you were meaning... :-)> Did you find that <%= form_for is now working for you?No, I have no idea. All my forms in edit and new views are <% form_for ... Should be <%= form_form inside <% form_for ? I posted the compilation error and the html code I have with <% form_for in previous messages. If is there something more I could show, please tell me. I''m interesting to know why it didn''t work. Thanks a lot! -- Posted via http://www.ruby-forum.com/. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 5 January 2011 20:41, Daniel Oton <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:>> As I asked before, please include the appropriate bits of the previous >> post in your message so that it makes sense. As it stands this >> message will now make no sense to someone finding the thread in the >> future. > > Ok, I didn''t know what you were meaning... :-) > >> Did you find that <%= form_for is now working for you? > > No, I have no idea. > > All my forms in edit and new views are <% form_for ... > > Should be <%= form_form inside <% form_for ?I don''t understand what you mean by form_for *inside* form_for. Are you using nested forms? However I now find myself very confused. I have just done some experiments and it seems that the = is not necessary. I am particularly confused as in the last few weeks there have been at least two occasions on which posters here have had problems which were fixed by using <%=. But as I said I have just tried myself and <% form_for seems to work perfectly ok. I do not understand this as I thought erb only included the result of the expression in the html if the = was present. Can someone with more knowledge of this comment please? 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Colin Law wrote in post #972629:> On 5 January 2011 20:41, Daniel Oton <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: >> >> All my forms in edit and new views are <% form_for ... >> >> Should be <%= form_form inside <% form_for ?Is form_form actually what you''re typing? It should be form_for . Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
> Is form_form actually what you''re typing? It should be form_for .No, sorry. Only bad typped when writing the post...>I don''t understand what you mean by form_for *inside* form_for. Are >you using nested forms?<% form_for(@item) do |f| %> <% form_for(@subitem) do |f| %> ... or something similar (Neither I don''t know if this is possible) Thanks -- Posted via http://www.ruby-forum.com/. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 5 January 2011 22:01, Daniel Oton <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:>> Is form_form actually what you''re typing? It should be form_for . > > No, sorry. Only bad typped when writing the post... > >>I don''t understand what you mean by form_for *inside* form_for. Are >>you using nested forms? > > <% form_for(@item) do |f| %> > <% form_for(@subitem) do |f| %> > > ... or something similar (Neither I don''t know if this is possible)No, nested forms are not allowed in html. You can have multiple submit buttons in one form though. 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.