Hi, I have a rails2.3 application and I have a requirement to override one of the view in the core module through plugin. In the core module view page, there is a text area to type the message. Now the requirement is to make it as like nicedit, redactor so that the message can be formatted. So I need to integrate any of the above js plugin editor and also some changes in view page. But I need to do it via plugins only... How is it possible. Any thoughts on this.. Or any reference with example would be highly appreciated.. I am new into plugin development... Please help. -- 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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/f02bc44ad90ff4b19db88a1d6d5409d0%40ruby-forum.com. For more options, visit https://groups.google.com/groups/opt_out.
Walter Lee Davis
2013-Sep-18 11:53 UTC
Re: overriding view page in core module through rails plugin
On Sep 18, 2013, at 1:55 AM, ruby rails wrote:> Hi, > > I have a rails2.3 application and I have a requirement to override one > of the view in the core module through plugin. In the core module view > page, there is a text area to type the message. Now the requirement is > to make it as like nicedit, redactor so that the message can be > formatted. So I need to integrate any of the above js plugin editor and > also some changes in view page. But I need to do it via plugins only... > How is it possible. Any thoughts on this.. Or any reference with example > would be highly appreciated.. I am new into plugin development... Please > help.Can you say a little more about why a plugin specifically is necessary here? Do you have access to the views? There are TNTC JavaScript textarea decorator functions out there -- google ''javascript textarea editor'' for an exhaustive list -- that have nothing to do with Rails at all, yet will serve you exceedingly well here. Look for one that serves all of its assets from a CDN, and you should be able to drop in a couple of lines of script in your _form.html.erb partial and be entirely done. Walter> > -- > 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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/f02bc44ad90ff4b19db88a1d6d5409d0%40ruby-forum.com. > For more options, visit https://groups.google.com/groups/opt_out.-- 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-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/46ED6814-7D74-4FB7-8016-521F9AF54AAF%40wdstudio.com. For more options, visit https://groups.google.com/groups/opt_out.
pradeep Achuthan
2013-Sep-19 07:56 UTC
Re: overriding view page in core module through rails plugin
I do have access to views... But I am not supposed to modify anything in core module since it is generic applicaiton.. So for my client they need this requirement.. So I am supposed to do it via plugin... On Wed, Sep 18, 2013 at 5:23 PM, Walter Lee Davis <waltd-HQgmohHLjDZWk0Htik3J/w@public.gmane.org>wrote:> > On Sep 18, 2013, at 1:55 AM, ruby rails wrote: > > > Hi, > > > > I have a rails2.3 application and I have a requirement to override one > > of the view in the core module through plugin. In the core module view > > page, there is a text area to type the message. Now the requirement is > > to make it as like nicedit, redactor so that the message can be > > formatted. So I need to integrate any of the above js plugin editor and > > also some changes in view page. But I need to do it via plugins only... > > How is it possible. Any thoughts on this.. Or any reference with example > > would be highly appreciated.. I am new into plugin development... Please > > help. > > Can you say a little more about why a plugin specifically is necessary > here? Do you have access to the views? There are TNTC JavaScript textarea > decorator functions out there -- google ''javascript textarea editor'' for an > exhaustive list -- that have nothing to do with Rails at all, yet will > serve you exceedingly well here. Look for one that serves all of its assets > from a CDN, and you should be able to drop in a couple of lines of script > in your _form.html.erb partial and be entirely done. > > Walter > > > > > -- > > 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 unsubscribe from this group and stop receiving emails from it, send > an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To view this discussion on the web visit > https://groups.google.com/d/msgid/rubyonrails-talk/f02bc44ad90ff4b19db88a1d6d5409d0%40ruby-forum.com > . > > For more options, visit https://groups.google.com/groups/opt_out. > > -- > 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-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit > https://groups.google.com/d/msgid/rubyonrails-talk/46ED6814-7D74-4FB7-8016-521F9AF54AAF%40wdstudio.com > . > For more options, visit https://groups.google.com/groups/opt_out. >-- 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-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAC%2BvJxAt8g%2BRPxhp2vnnsAkFx3ZDFX4%3DeTi8Ff_WdvONWEt4bg%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
Walter Lee Davis
2013-Sep-19 11:53 UTC
Re: overriding view page in core module through rails plugin
On Sep 19, 2013, at 3:56 AM, pradeep Achuthan wrote:> I do have access to views... But I am not supposed to modify anything in core module since it is generic applicaiton.. So for my client they need this requirement.. So I am supposed to do it via plugin...The only such things that I have seen as plugins are for FCEditor and other such things, and even the ones that are distributed as Rails gems or plug-ins still require you to modify the views to some extent. Either you have to substitute one generator for another (text_area becomes fc_text_area or something like that) or you have to configure *something* to indicate which fields need this treatment. So I don''t see how this is going to be any different if you have a plug-in. Walter> > > On Wed, Sep 18, 2013 at 5:23 PM, Walter Lee Davis <waltd-HQgmohHLjDZWk0Htik3J/w@public.gmane.org> wrote: > > On Sep 18, 2013, at 1:55 AM, ruby rails wrote: > > > Hi, > > > > I have a rails2.3 application and I have a requirement to override one > > of the view in the core module through plugin. In the core module view > > page, there is a text area to type the message. Now the requirement is > > to make it as like nicedit, redactor so that the message can be > > formatted. So I need to integrate any of the above js plugin editor and > > also some changes in view page. But I need to do it via plugins only... > > How is it possible. Any thoughts on this.. Or any reference with example > > would be highly appreciated.. I am new into plugin development... Please > > help. > > Can you say a little more about why a plugin specifically is necessary here? Do you have access to the views? There are TNTC JavaScript textarea decorator functions out there -- google ''javascript textarea editor'' for an exhaustive list -- that have nothing to do with Rails at all, yet will serve you exceedingly well here. Look for one that serves all of its assets from a CDN, and you should be able to drop in a couple of lines of script in your _form.html.erb partial and be entirely done. > > Walter > > > > > -- > > 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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/f02bc44ad90ff4b19db88a1d6d5409d0%40ruby-forum.com. > > For more options, visit https://groups.google.com/groups/opt_out. > > -- > 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-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/46ED6814-7D74-4FB7-8016-521F9AF54AAF%40wdstudio.com. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- > 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-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAC%2BvJxAt8g%2BRPxhp2vnnsAkFx3ZDFX4%3DeTi8Ff_WdvONWEt4bg%40mail.gmail.com. > For more options, visit https://groups.google.com/groups/opt_out.-- 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-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/D064368B-F316-45CA-90FC-655FB74DE3E2%40wdstudio.com. For more options, visit https://groups.google.com/groups/opt_out.
Walter Lee Davis
2013-Sep-19 13:23 UTC
Re: overriding view page in core module through rails plugin
Here''s a couple of examples that show what I mean. First, an injected editor: http://scripty.walterdavisstudio.com/injected-editor.html If you disable JavaScript, you will see the form in its natural state -- it''s just a form, such as Rails might generate for you. When you re-enable JavaScript (and maybe reload) the textarea is decorated with a WYSIWYG editor. No change to the (view) code needed. This example doesn''t show any toolbars for adding new elements to the content, so... http://scripty.walterdavisstudio.com/editable.html This is a different approach, without any form in place, but showing a toolbar. Just to show you what else you can do with the contenteditable control. A combination of the two would get you everything you need. Walter On Sep 19, 2013, at 7:53 AM, Walter Lee Davis wrote:> > On Sep 19, 2013, at 3:56 AM, pradeep Achuthan wrote: > >> I do have access to views... But I am not supposed to modify anything in core module since it is generic applicaiton.. So for my client they need this requirement.. So I am supposed to do it via plugin... > > The only such things that I have seen as plugins are for FCEditor and other such things, and even the ones that are distributed as Rails gems or plug-ins still require you to modify the views to some extent. Either you have to substitute one generator for another (text_area becomes fc_text_area or something like that) or you have to configure *something* to indicate which fields need this treatment. So I don''t see how this is going to be any different if you have a plug-in. > > Walter > >> >> >> On Wed, Sep 18, 2013 at 5:23 PM, Walter Lee Davis <waltd-HQgmohHLjDZWk0Htik3J/w@public.gmane.org> wrote: >> >> On Sep 18, 2013, at 1:55 AM, ruby rails wrote: >> >>> Hi, >>> >>> I have a rails2.3 application and I have a requirement to override one >>> of the view in the core module through plugin. In the core module view >>> page, there is a text area to type the message. Now the requirement is >>> to make it as like nicedit, redactor so that the message can be >>> formatted. So I need to integrate any of the above js plugin editor and >>> also some changes in view page. But I need to do it via plugins only... >>> How is it possible. Any thoughts on this.. Or any reference with example >>> would be highly appreciated.. I am new into plugin development... Please >>> help. >> >> Can you say a little more about why a plugin specifically is necessary here? Do you have access to the views? There are TNTC JavaScript textarea decorator functions out there -- google ''javascript textarea editor'' for an exhaustive list -- that have nothing to do with Rails at all, yet will serve you exceedingly well here. Look for one that serves all of its assets from a CDN, and you should be able to drop in a couple of lines of script in your _form.html.erb partial and be entirely done. >> >> Walter >> >>> >>> -- >>> 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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>> To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/f02bc44ad90ff4b19db88a1d6d5409d0%40ruby-forum.com. >>> For more options, visit https://groups.google.com/groups/opt_out. >> >> -- >> 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-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/46ED6814-7D74-4FB7-8016-521F9AF54AAF%40wdstudio.com. >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> -- >> 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-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAC%2BvJxAt8g%2BRPxhp2vnnsAkFx3ZDFX4%3DeTi8Ff_WdvONWEt4bg%40mail.gmail.com. >> For more options, visit https://groups.google.com/groups/opt_out. > > -- > 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-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/D064368B-F316-45CA-90FC-655FB74DE3E2%40wdstudio.com. > For more options, visit https://groups.google.com/groups/opt_out.-- 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-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/F7909D51-5A7F-4EDA-B881-D7DB6F561A3F%40wdstudio.com. For more options, visit https://groups.google.com/groups/opt_out.