Jose Carlos
2006-Feb-09 11:37 UTC
[Rails] Howto work with a page not generated by the scaffold ?
I am a newbie Ruby and RoR user. In my tests using the turorials that I found over the web, everthing is working fine and I am very impressed about RoR framework. As I am a Delphi developer, without any web development experience, There is some thing hard to understando and I didn''t find a tutorial about this. I wonder how to create a non-scaffold page ? I have customers, products and orders for example, and I want to create a page to view the orders between two dates. So, I need a page that will ask for initial and final date, I will select the records matching this criteria in the orders date and joining this 3 tables? Thanks in advance. -- Posted via http://www.ruby-forum.com/.
oo00oo
2006-Feb-09 13:12 UTC
[Rails] Howto work with a page not generated by the scaffold ?
Hello, Look here : http://www.pragmaticprogrammer.com/titles/rails/index.html You need to do the depot tutorial to understand the basic You can download the source of the depot tutorial here. Watch the source. Very good practice http://www.pragmaticprogrammer.com/titles/rails/code.html> I am a newbie Ruby and RoR user. In my tests using the turorials that > I found over the web, everthing is working fine and I am very impressed > about RoR framework. > > As I am a Delphi developer, without any web development experience, > There is some thing hard to understando and I didn''t find a tutorial > about this. > > > I wonder how to create a non-scaffold page ? I have customers, products > and orders for example, and I want to create a page to view the orders > between two dates. So, I need a page that will ask for initial and final > date, I will select the records matching this criteria in the orders > date and joining this 3 tables? > > > > Thanks in advance. > > > >
Marco Casario
2006-Feb-09 13:16 UTC
[Rails] Error on code of the book Aigle Web Development with Rails
hi all, I''m reading the Agile WebDevelopment with Ruby on Rails but I obtain an error for the code at page 111. This is the error : SyntaxError in Admin#ship Showing app/views/admin/ship.rhtml where line #8 raised: compile error ./script/../config/../app/views/admin/ship.rhtml:8: syntax error _erbout.concat(( end _form_tag ).to_s); _erbout.concat "\n" ^ Extracted source (around line #8): 5: </table> 6: <br /> 7: <input type="submit" value=" INVIA ITEM CHEKATI " /> 8: <%= end _form_tag %> 9: 10: Trace of template inclusion: /app/views/admin/ship.rhtml RAILS_ROOT: ./script/../config/.. and this is the code : <h1>Ordini da spedire</h1> <%= form_tag(:action => "ship") %> <table> <%= render(:partial => "order_line", :collection => @pending_orders) %> </table> <br /> <input type="submit" value=" INVIA ITEM CHEKATI " /> <%= end _form_tag %> What''s wrong with it ?? thanks marco
Mikkel Bruun
2006-Feb-09 13:20 UTC
[Rails] Error on code of the book Aigle Web Development with Rails
On Thursday, February 09, 2006, at 5:16 AM, Marco Casario wrote:>hi all, >I''m reading the Agile WebDevelopment with Ruby on Rails but I obtain an >error for the code at page 111. >This is the error : >SyntaxError in Admin#ship >Showing app/views/admin/ship.rhtml where line #8 raised: > >compile error >./script/../config/../app/views/admin/ship.rhtml:8: syntax error >_erbout.concat(( end _form_tag ).to_s); _erbout.concat "\n" > ^ >Extracted source (around line #8): > >5: </table> >6: <br /> >7: <input type="submit" value=" INVIA ITEM CHEKATI " /> >8: <%= end _form_tag %> >9: >10: >whitespace after end in <%= end _form_tag %> should be <%= end_form_tag %> Mikkel Bruun www.strongside.dk - Football Portal(DK) nflfeed.helenius.org - Football News(DK) ting.minline.dk - Buy Old Stuff!(DK) -- Posted with http://DevLists.com. Sign up and save your time!
Jose Carlos Da cunha jr
2006-Feb-09 13:35 UTC
[Rails] Re: Howto work with a page not generated by the scaffold ?
oo00oo wrote:> Hello, > > Look here : http://www.pragmaticprogrammer.com/titles/rails/index.html > You need to do the depot tutorial to understand the basic > > You can download the source of the depot tutorial here. Watch the > source. Very good practice > http://www.pragmaticprogrammer.com/titles/rails/code.htmlThank you oo00oo to answer my post. This is a great book, I have it. Maybe I missunderstood something.. I will take a look on it again. Anyway, Could someone give me the basics steps to create a page for searching records in a join SQL ? I am not asking for a sample code. Thank you -- Posted via http://www.ruby-forum.com/.
oo00oo
2006-Feb-09 13:43 UTC
Re: Re: Howto work with a page not generated by the scaffold ?
find method is powerfull but if you need to do complex query use find_by_sql http://api.rubyonrails.org/classes/ActiveRecord/Base.html#M000716 Thank you oo00oo to answer my post. This is a great book, I have it. Maybe I missunderstood something.. I will take a look on it again. Anyway, Could someone give me the basics steps to create a page for searching records in a join SQL ? I am not asking for a sample code. Thank you _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Marco Casario
2006-Feb-09 14:17 UTC
[Rails] Error on code of the book Aigle Web Development with Rails
thanks :) you got it :) too tired best marco ----- Original Message ----- From: "Mikkel Bruun" <devlists-rubyonrails@devlists.com> To: <rails@lists.rubyonrails.org> Sent: Thursday, February 09, 2006 5:20 AM Subject: Re: [Rails] Error on code of the book Aigle Web Development with Rails> > On Thursday, February 09, 2006, at 5:16 AM, Marco Casario wrote: >>hi all, >>I''m reading the Agile WebDevelopment with Ruby on Rails but I obtain an >>error for the code at page 111. >>This is the error : >>SyntaxError in Admin#ship >>Showing app/views/admin/ship.rhtml where line #8 raised: >> >>compile error >>./script/../config/../app/views/admin/ship.rhtml:8: syntax error >>_erbout.concat(( end _form_tag ).to_s); _erbout.concat "\n" >> ^ >>Extracted source (around line #8): >> >>5: </table> >>6: <br /> >>7: <input type="submit" value=" INVIA ITEM CHEKATI " /> >>8: <%= end _form_tag %> >>9: >>10: >> > > whitespace after end in <%= end _form_tag %> > > should be <%= end_form_tag %> > > > Mikkel Bruun > > www.strongside.dk - Football Portal(DK) > nflfeed.helenius.org - Football News(DK) > ting.minline.dk - Buy Old Stuff!(DK) > > > > > -- > Posted with http://DevLists.com. Sign up and save your time! > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > >
Andrew Otwell
2006-Feb-09 15:40 UTC
[Rails] Re: Howto work with a page not generated by the scaffold ?
>> Look here : http://www.pragmaticprogrammer.com/titles/rails/index.html >> You need to do the depot tutorial to understand the basic >> >> You can download the source of the depot tutorial here. Watch the >> source. Very good practice >> http://www.pragmaticprogrammer.com/titles/rails/code.html > > > Thank you oo00oo to answer my post. > > This is a great book, I have it. > > Maybe I missunderstood something.. I will take a look on it again.I don''t want to sound rude, but the Agile book answers your questions virtually in the first chapter, you really should look at it again. I suggest you not worry about the join table stuff until you at least feel comfortable writing your own non-scaffold code. There are also plenty of other tutorials about Rails that take you from scaffolding pages to custom pages. The "4 Days on Rails" tutorial is very good, although I don''t know if it''s been updated recently. http:// rails.homelinux.org/ Curt Hibbs'' tutorials are also very good and teach you how to go beyond scaffolding. http://www.onlamp.com/pub/a/onlamp/ 2005/01/20/rails.html -- Posted with http://DevLists.com. Sign up and save your time!
Jose Carlos Da cunha jr
2006-Feb-09 16:18 UTC
[Rails] Re: Howto work with a page not generated by the scaffold ?
Andrew Otwell wrote:>> This is a great book, I have it. >> >> Maybe I missunderstood something.. I will take a look on it again. > > I don''t want to sound rude, but the Agile book answers your questions > virtually in the first chapter, you really should look at it again. I > suggest you not worry about the join table stuff until you at least feel > comfortable writing your own non-scaffold code. > > There are also plenty of other tutorials about Rails that take you from > scaffolding pages to custom pages. The "4 Days on Rails" tutorial is > very good, although I don''t know if it''s been updated recently. http:// > rails.homelinux.org/ Curt Hibbs'' tutorials are also very good and teach > you how to go beyond scaffolding. http://www.onlamp.com/pub/a/onlamp/ > 2005/01/20/rails.htmlAndrew, Thanks very much for your reply, you didn''t sound rude. I will really start from the "beginning" of the Agile book. -- Posted via http://www.ruby-forum.com/.
Ben Munat
2006-Feb-09 17:17 UTC
[Rails] Howto work with a page not generated by the scaffold ?
Jose, I''m a java programmer working at a shop full of delphi programmers and I have watched a couple of them transition to java web apps. One thing that I noticed is that, when one is learning a new language and a new framework and html/css/http all at the same time, it''s very easy for stuff to get jumbled together... It can be hard to distinguish what the language/framework are doing for you vs. the basic standard web stuff. So, you might want to spend a little time just reading through some tutorials on xhtml and css and how http post/get requests work. There''s lots of this stuff on the web! w3schools is a pretty decent site full of tutorials: http://www.w3schools.com/ just my 2 cents... b Jose Carlos wrote:> I am a newbie Ruby and RoR user. In my tests using the turorials that > I found over the web, everthing is working fine and I am very impressed > about RoR framework. > > As I am a Delphi developer, without any web development experience, > There is some thing hard to understando and I didn''t find a tutorial > about this. > > > I wonder how to create a non-scaffold page ? I have customers, products > and orders for example, and I want to create a page to view the orders > between two dates. So, I need a page that will ask for initial and final > date, I will select the records matching this criteria in the orders > date and joining this 3 tables? > > > > Thanks in advance. > > >
Anne G
2006-Feb-10 01:02 UTC
[Rails] Howto work with a page not generated by the scaffold ?
I too was trying to figure out such things. I need a page that will ask for initial and final date, this would be a form page, so it would be a view. It would go in the view folder. You could have an action getdates det getdates end in controller which automatically will call getdates.rhtml in the view folder. You will get the info from this page in the params. Look up render to look at the param hash. The controller can then select all the data, and go to another view page, show.rhtml. You don''t need to use scaffold at all. Here is what I found http://wrath.rubyonrails.org/pipermail/rails/2006-February/016082.html I also found the following tutorial which is more about understanding http://www.troubleshooters.com/codecorn/ruby/rails/rapidlearning_rails.htm I will be happy to help if I can, I only have a couple weeks on this myself. anne
Dylan Stamat
2006-Feb-10 01:06 UTC
[Rails] Howto work with a page not generated by the scaffold ?
Hey Anne ! Thanks for the links ! I think after a while, you don''t use scaffold at all... at least I don''t anymore. You just start building your application page by page, action by action, component by component... etc. I think scaffold is just a "ooooooo look what rails can do" type thing that get''s people started. I think... or I may be missing an amazing feature and I''m wasting a lot of time... but, I don''t think so :) On 2/9/06, Anne G <anne@wjh.harvard.edu> wrote:> > > I too was trying to figure out such things. > > I need a page that will ask for initial and final > date, > > this would be a form page, so it would be a view. It would > go in the view folder. You could have an action getdates > det getdates > end > in controller which automatically will call getdates.rhtml > in the view folder. > > You will get the info from this page in the params. Look up > render to look at the param hash. > > The controller can then select all the data, and go to > another view page, show.rhtml. > > You don''t need to use scaffold at all. > > Here is what I found > http://wrath.rubyonrails.org/pipermail/rails/2006-February/016082.html > > I also found the following tutorial which is more about > understanding > http://www.troubleshooters.com/codecorn/ruby/rails/rapidlearning_rails.htm > > I will be happy to help if I can, I only have a couple weeks > on this myself. > > anne > > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060210/89e1655c/attachment.html
anne g
2006-Feb-10 01:27 UTC
[Rails] Re: Howto work with a page not generated by the scaffold ?
> I think scaffold is just a "ooooooo look what rails can do" type thingYap, and I have become allergic to the word scaffold and to that attitude, and I prefer to ignore politly anyone suggesting that since there is scaffold, I should use it. Rails is not for the true beginner. There is a lot of learning to do just to get to the first chapter of agile rails. some pros don''t understand that. Now that I am starting to understand, I will certainly never use scaffold, symbol a certain humiliation: How hard it was to figure out just one of the lines of that oh so elegant program!
Dave Silvester
2006-Feb-10 01:44 UTC
[Rails] Re: Howto work with a page not generated by the scaffold ?
On Friday 10 Feb 2006 01:26, anne g wrote:> Now that I am starting to understand, I will certainly never use scaffold,Well, there''s no harm in using the scaffold generator to put the absolute basics in place before fleshing them out yourself. I still use them, because it''s useful for getting stuff up and running as quick as possible. Soon though, I''m planning to develop my own customised engines to rapidly implement the kind of stuff I need on almost every website - news sections, link pages, standard contact forms and so on. Might as well practise DRY between projects, as well as in them... :-) ~Dave -- Dave Silvester Rent-A-Monkey Website Development http://www.rentamonkey.com/ PGP Key: http://www.rentamonkey.com/pgpkey.asc