Ok, through extreme trial and error I''ve managed not to bug this list (and I''m a Windows guy that managed to install Rails on my ISP''s Apache VirtualHost with symlinks to get it working inside a PHP app) but this one has me stumped. I learned that Rails turns tinyint(1) fields into boolean but I don''t see why the "generate scaffold" fails when a field is named "open". If I change the name it''s fine, if I change the field type it''s also fine. It''s only this magic combination of naming a field "open" when it''s a tinyint(1). when I call: ./script/generate scaffold MyClass I get some files and then: wrong number of arguments (0 for 1) I know the workaround but some questions: 1. Would there have been a better way to debug the error? Seems sorta vague and left me hanging, not knowing where to look. 2. Is there a doc that specifies all these ActiveRecord auto-behaviours in a summary format (vs. being spread across 10 different places?) 3. Could I prevent "generate scaffold" from turning my tinyint into a boolean if I wanted? Not that I do but I''m curious. Thanks, Shawn Oster -- Posted via http://www.ruby-forum.com/.
Hi, I didn''t look into the cause but I would guess that there is a method named open? in ActiveRecord or a related class. When you add a boolean column a method named <column>? is added. Thus when your model adds a column named open that is boolean, open? will be generated and this will conflict with the AR method. HTH -- Cheers, Peter Donald Blog: http://www.RealityForge.org On 12/14/05, Shawn Oster <shawn.oster-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Ok, through extreme trial and error I''ve managed not to bug this list > (and I''m a Windows guy that managed to install Rails on my ISP''s Apache > VirtualHost with symlinks to get it working inside a PHP app) but this > one has me stumped. > > I learned that Rails turns tinyint(1) fields into boolean but I don''t > see why the "generate scaffold" fails when a field is named "open". If > I change the name it''s fine, if I change the field type it''s also fine. > It''s only this magic combination of naming a field "open" when it''s a > tinyint(1). > > when I call: > ./script/generate scaffold MyClass > > I get some files and then: > wrong number of arguments (0 for 1) > > I know the workaround but some questions: > > 1. Would there have been a better way to debug the error? Seems sorta > vague and left me hanging, not knowing where to look. > > 2. Is there a doc that specifies all these ActiveRecord auto-behaviours > in a summary format (vs. being spread across 10 different places?) > > 3. Could I prevent "generate scaffold" from turning my tinyint into a > boolean if I wanted? Not that I do but I''m curious. > > Thanks, > Shawn Oster > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Samo Korosec
2005-Dec-14 09:30 UTC
(newbie?) Questions regarding local Rails installations as a CMS for remote websites
Hiya, I hope this is the right place to ask. I''m new to Ruby and Rails and after some of the demos I saw I want to make my next CMS with Rails. The idea behind using Rails is basically to have the Rails CMS run locally on the customer''s intranet/computer and synchronising it with their website as needed. The reason for the more "complicated" approach is the tendency of customers to have "their" webspace providers run anything from Linux/PHP/MySQL only to Windows/PHP/MSSQL and I don''t want to rewrite the CMS all the time - plus they have an up to date version of their website for backup at all times. So the questions: Is something like that feasible? I tought of uploading new content via FTP and sending an update to MySQL directly or even uploading an XML file and loading that into MySQL via PHP/ Whatever. Are there ways to simply synchronise/access the remote (My) SQL database and upload the neccessary data via FTP? Do you guys have any pointers where I should look for the relevant information or which functions/functionality I should look up in the documentation? Are there any special situations to consider or does anyone have experience with something similiar? I hope that''s not too vague/newbish, have a nice day everyone! Samo
Samo Korosec
2005-Dec-14 19:24 UTC
Re: (newbie?) Questions regarding local Rails installations as a CMS for remote websites
No love? :o( On Dec 14, 2005, at 10:30 AM, Samo Korosec wrote:> Hiya, > > I hope this is the right place to ask. I''m new to Ruby and Rails > and after some of the demos I saw I want to make my next CMS with > Rails. The idea behind using Rails is basically to have the Rails > CMS run locally on the customer''s intranet/computer and > synchronising it with their website as needed. The reason for the > more "complicated" approach is the tendency of customers to have > "their" webspace providers run anything from Linux/PHP/MySQL only > to Windows/PHP/MSSQL and I don''t want to rewrite the CMS all the > time - plus they have an up to date version of their website for > backup at all times. > > So the questions: Is something like that feasible? I tought of > uploading new content via FTP and sending an update to MySQL > directly or even uploading an XML file and loading that into MySQL > via PHP/Whatever. Are there ways to simply synchronise/access the > remote (My)SQL database and upload the neccessary data via FTP? Do > you guys have any pointers where I should look for the relevant > information or which functions/functionality I should look up in > the documentation? Are there any special situations to consider or > does anyone have experience with something similiar? > > I hope that''s not too vague/newbish, have a nice day everyone! > Samo_______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails
Scott Phelps
2005-Dec-14 19:36 UTC
Re: (newbie?) Questions regarding local Rails installations as a CMS for remote websites
On Dec 14, 2005, at 2:24 PM, Samo Korosec wrote:>> Ruby and Rails and after some of the demos I saw I want to make >> my next CMS with Rails. The idea behind using Rails is basically >> to have the Rails CMS run locally on the customer''s intranet/ >> computer and synchronising it with their website as needed. The >> reason for the more "complicated" approach is the tendency of >> customers to have "their" webspace providers run anything from >> Linux/PHP/MySQL only to Windows/PHP/MSSQL and I don''t want to >> rewrite the CMS all the time - plus they have an up to date >> version of their website for backup at all times. >> >> So the questions: Is something like that feasible? I tought of >> uploading new content via FTP and sending an update to MySQL >> directly or even uploading an XML file and loading that into MySQL >> via PHP/Whatever. Are there ways to simply synchronise/access the >> remote (My)SQL database and upload the neccessary data via FTP? Do >> you guys have any pointers where I should look for the relevant >> information or which functions/functionality I should look up in >> the documentation? Are there any special situations to consider or >> does anyone have experience with something similiar?This is kinda vague. Depending on the content you could simply use SOAP to perform the necessary RPC''s between these distributed processes.
Samo Korosec
2005-Dec-14 19:57 UTC
Re: (newbie?) Questions regarding local Rails installations as a CMS for remote websites
On Dec 14, 2005, at 8:36 PM, Scott Phelps wrote:> > On Dec 14, 2005, at 2:24 PM, Samo Korosec wrote: >>> Ruby and Rails and after some of the demos I saw I want to make >>> my next CMS with Rails. The idea behind using Rails is basically >>> to have the Rails CMS run locally on the customer''s intranet/ >>> computer and synchronising it with their website as needed. The >>> reason for the more "complicated" approach is the tendency of >>> customers to have "their" webspace providers run anything from >>> Linux/PHP/MySQL only to Windows/PHP/MSSQL and I don''t want to >>> rewrite the CMS all the time - plus they have an up to date >>> version of their website for backup at all times. >>> >>> So the questions: Is something like that feasible? I tought of >>> uploading new content via FTP and sending an update to MySQL >>> directly or even uploading an XML file and loading that into >>> MySQL via PHP/Whatever. Are there ways to simply synchronise/ >>> access the remote (My)SQL database and upload the neccessary data >>> via FTP? Do you guys have any pointers where I should look for >>> the relevant information or which functions/functionality I >>> should look up in the documentation? Are there any special >>> situations to consider or does anyone have experience with >>> something similiar? > > This is kinda vague. Depending on the content you could simply use > SOAP to perform the necessary RPC''s between these distributed > processes.It''s vague because I have a bunch of different platforms to potentially deal with, most of the time with very limited options to adapt said systems. :o) My thinking was to simply keep track of what has been updated and either generate SQL or an XML file of the content and articles. Then those would be parsed on the server and the media would be uploaded via FTP. Where I was unsure is whether the FTP and MySQL-related functionality is there (in Ruby and Rails), so I can simply present the user a "synchronise" button and the data is pushed. I don''t need realtime synchronisation and would prefer to keep as much as possible in Ruby/Rails, so I can deploy it with the customer without the need to rewrite the CMS all the time for different hosting solutions. And of course it has to be done yesterday, so a simple solution would be best. Thanks for the response! Samo
Scott Phelps
2005-Dec-14 20:20 UTC
Re: (newbie?) Questions regarding local Rails installations as a CMS for remote websites
On Dec 14, 2005, at 2:57 PM, Samo Korosec wrote:> > On Dec 14, 2005, at 2:24 PM, Samo Korosec wrote: >>> Ruby and Rails and after some of the demos I saw I want to make >>> my next CMS with Rails. The idea behind using Rails is basically >>> to have the Rails CMS run locally on the customer''s intranet/ >>> computer and synchronising it with their website as needed. The >>> reason for the more "complicated" approach is the tendency of >>> customers to have "their" webspace providers run anything from >>> Linux/PHP/MySQL only to Windows/PHP/MSSQL and I don''t want to >>> rewrite the CMS all the time - plus they have an up to date >>> version of their website for backup at all times. >>> >>> So the questions: Is something like that feasible? I tought of >>> uploading new content via FTP and sending an update to MySQL >>> directly or even uploading an XML file and loading that into >>> MySQL via PHP/Whatever. Are there ways to simply synchronise/ >>> access the remote (My)SQL database and upload the neccessary data >>> via FTP? Do you guys have any pointers where I should look for >>> the relevant information or which functions/functionality I >>> should look up in the documentation? Are there any special >>> situations to consider or does anyone have experience with >>> something similiar? > > This is kinda vague. Depending on the content you could simply use > SOAP to perform the necessary RPC''s between these distributed > processes.It''s vague because I have a bunch of different platforms to potentially deal with, most of the time with very limited options to adapt said systems. :o) My thinking was to simply keep track of what has been updated and either generate SQL or an XML file of the content and articles. Then those would be parsed on the server and the media would be uploaded via FTP. Where I was unsure is whether the FTP and MySQL-related functionality is there (in Ruby and Rails), Rails is not SQL specific it uses the Active Record ORM. As far as FTP - that is not a function (api) in any languages I know of. You''ll have to write it in Ruby or use post data for uploads.>>> so I can simply present the user a "synchronise" button and the >>> data is pushed. I don''t need realtime synchronisation and would >>> prefer to keep as much as possible in Ruby/Rails, so I can deploy >>> it with the customer without the need to rewrite the CMS all the >>> time for different hosting solutions.>>> And of course it has to be done yesterday, so a simple solution >>> would be best.LOL!
Samo Korosec
2005-Dec-14 20:35 UTC
Re: (newbie?) Questions regarding local Rails installations as a CMS for remote websites
On Dec 14, 2005, at 9:20 PM, Scott Phelps wrote:> > Rails is not SQL specific it uses the Active Record ORM.Ah, so I''d need to generate the SQL with MySQL. That''s ok, I can keep track of the row IDs and get those then.> As far as FTP - that is not a function (api) in any languages I > know of. You''ll have to write it in Ruby or use post data for > uploads.Well it''s part of the APIs used with Cocoa (CoreFoundation, CFFTP) and PHP also offers functions to upload open files via FTP (ftp_put), so I tought it''s part of the Ruby installation (or availible as a gem).>>>> And of course it has to be done yesterday, so a simple solution >>>> would be best. > > LOL!Tell me about it... :-/ Thanks anyhow! Samo
Scott Phelps
2005-Dec-14 21:07 UTC
Re: (newbie?) Questions regarding local Rails installations as a CMS for remote websites
On Dec 14, 2005, at 3:35 PM, Samo Korosec wrote:> > On Dec 14, 2005, at 9:20 PM, Scott Phelps wrote: > >> >> Rails is not SQL specific it uses the Active Record ORM. > > Ah, so I''d need to generate the SQL with MySQL. That''s ok, I can > keep track of the row IDs and get those then. > >> As far as FTP - that is not a function (api) in any languages I >> know of. You''ll have to write it in Ruby or use post data for >> uploads. > > Well it''s part of the APIs used with Cocoa (CoreFoundation, CFFTP) > and PHP also offers functions to upload open files via FTP > (ftp_put), so I tought it''s part of the Ruby installation (or > availible as a gem).That was dumb of me to say that. Ruby has it! http://www.ruby-doc.org/stdlib/libdoc/net/ftp/rdoc/ I didn''t know PHP had that too, cool.
Kyle Maxwell
2005-Dec-14 21:12 UTC
Re: (newbie?) Questions regarding local Rails installations as a CMS for remote websites
Why are you wanting to develop yet another CMS? There are hundreds, possibly thousands, of OSS and commercial CMS''s available. Surely one of them does what you want. If not, then find an OSS one and modify it. Off the top of my head, Macromedia/Adobe Contribute and Fog Creek Citydesk would be the closest matches to what you envision. I don''t know of their OSS equivalents. Kyle On 12/14/05, Samo Korosec <xype-tMYdrf6f3e3R7s880joybQ@public.gmane.org> wrote:> Hiya, > > I hope this is the right place to ask. I''m new to Ruby and Rails and > after some of the demos I saw I want to make my next CMS with Rails. > The idea behind using Rails is basically to have the Rails CMS run > locally on the customer''s intranet/computer and synchronising it with > their website as needed. The reason for the more "complicated" > approach is the tendency of customers to have "their" webspace > providers run anything from Linux/PHP/MySQL only to Windows/PHP/MSSQL > and I don''t want to rewrite the CMS all the time - plus they have an > up to date version of their website for backup at all times. > > So the questions: Is something like that feasible? I tought of > uploading new content via FTP and sending an update to MySQL directly > or even uploading an XML file and loading that into MySQL via PHP/ > Whatever. Are there ways to simply synchronise/access the remote (My) > SQL database and upload the neccessary data via FTP? Do you guys have > any pointers where I should look for the relevant information or > which functions/functionality I should look up in the documentation? > Are there any special situations to consider or does anyone have > experience with something similiar? > > I hope that''s not too vague/newbish, have a nice day everyone! > Samo > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Samo Korosec
2005-Dec-14 21:30 UTC
Re: (newbie?) Questions regarding local Rails installations as a CMS for remote websites
Heh, I just found that, too. Now I need a solution for the database data, but that one wont be that hard. Thanks for the time and the inspiration to actually hit up the documentation! ;o) On Dec 14, 2005, at 10:07 PM, Scott Phelps wrote:> > That was dumb of me to say that. Ruby has it! > > http://www.ruby-doc.org/stdlib/libdoc/net/ftp/rdoc/ > > I didn''t know PHP had that too, cool.
Samo Korosec
2005-Dec-14 22:41 UTC
Re: (newbie?) Questions regarding local Rails installations as a CMS for remote websites
I want something that can drive Flash and HTML websites, that is easy to use and looks great (I only just started - http://www.froodee.net/ misc/cms_ui_01.jpg ). With Rails I think the development can be simplified quite a bit and with AJAX and script.aculo.us I can actually make a useable Interface for it. I only need simple articles, media files and galleries for now, but later on I want to be able to extend it with a media management system, product database and catalogue system with the ability to generate print-ready PDFs. The fields I work in (marketing agencies, architecture bureaus, etc) would welcome simple solutions for that and of all the CMS systems I reviewed most seem to be done by programmers who stuff them full of features the secretary responsible for updating the company website will only get a heart attack from. And I think adapting one of those systems to suit my needs (and possibly maintaining a fork after that) would take as long if not longer than writing a simple one from scratch would. Besides, any excuse to propagate the useage of Rails is good enough for me. ;o) I know that "I R write teh CMS" sounds just like game developers who want to develop their own engine instead of using something that is already there and works just as well, but I considered a few solutions already and none of them works for me. Samo On Dec 14, 2005, at 10:12 PM, Kyle Maxwell wrote:> Why are you wanting to develop yet another CMS? There are hundreds, > possibly thousands, of OSS and commercial CMS''s available. Surely one > of them does what you want. If not, then find an OSS one and modify > it. Off the top of my head, Macromedia/Adobe Contribute and Fog Creek > Citydesk would be the closest matches to what you envision. I don''t > know of their OSS equivalents. > > Kyle
Beate Paland
2005-Dec-14 22:58 UTC
Re: (newbie?) Questions regarding local Rails installations as a CMS for remote websites
Hi Samo, screenshot lookes nice! And your idea is also nice, I think, if the customers are satisfied with static pages (no dynamic content like contact forms). And I agree with you that modifying a existing system takes as long as coding new (I thought about this with an online shop recently). So I''d like to encourage you doing this in rails and please keep us informed about further goings ;) regards, Beate
Samo Korosec
2005-Dec-14 23:05 UTC
Re: (newbie?) Questions regarding local Rails installations as a CMS for remote websites
Thanks! Will see how I make progress and if it goes well, I''ll probably release it anyway. :o) On Dec 14, 2005, at 11:58 PM, Beate Paland wrote:> Hi Samo, > > screenshot lookes nice! And your idea is also nice, I think, if the > customers are satisfied with static pages (no dynamic content like > contact forms). And I agree with you that modifying a existing system > takes as long as coding new (I thought about this with an online shop > recently). > > So I''d like to encourage you doing this in rails and please keep us > informed about further goings ;) > > regards, > Beate > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails
Alain Ravet
2005-Dec-15 00:16 UTC
Re: (newbie?) Questions regarding local Rails installations
Samo, Next time, please create a new thread. By hijacking an existing thread, your question will be invisible to all people who don''t read/hide the master thread. Alain. -- Posted via http://www.ruby-forum.com/.