Hi all! I have a simple (hope ... ) question for you about RoR. I am new to it .. not so new in programming and with a few of know how on ruby. I would like to load ... by example ... the rexml class. I tried to do it inside a controller ... but it didn''t worked out ... I create a file inside the view/myTest folder ... put inside the code ... but nothing again... It gives to me Application Error... How can I solve it ... where have I to insert the require ''rexml/document'' ...?? The right way?? Someone could help me?? Thanks ... -- ------------------------------------------- Gioachino Bartolotta ICQ #: 9103167 MSN Messenger: astraroth-06ZeP6ie+xM@public.gmane.org Yahoo & Skype: gioachino_bartolotta
> I would like to load ... by example ... the rexml class. > I tried to do it inside a controller ... but it didn''t worked out ... > I create a file inside the view/myTest folder ... put inside the code > ... but nothing again... > It gives to me Application Error... > How can I solve it ... where have I to insert the require ''rexml/ > document'' ...??This should go in conifg/environment.rb, however the example of rexml was a bad one since it is required by default already with Rails. To test this, go to ./script/console and type REXML::Document.new -Lucas
Hi Lucas ... I understood, but why it doesn''t work when I try to open an xml file ...? I used REXML to process files from console... but if I try from RoR it gives me Application Error... on the error log it says bad header and gives me the first node of xml file ....? Is there a way to proceed?? Another question ... where I can find documentation about RoR and ajax?? Thanks ... -- ------------------------------------------- Gioachino Bartolotta ICQ #: 9103167 MSN Messenger: astraroth-06ZeP6ie+xM@public.gmane.org Yahoo & Skype: gioachino_bartolotta 2005/8/6, Lucas Carlson <rails-1eRuzFDw/cg@public.gmane.org>:> > I would like to load ... by example ... the rexml class. > > I tried to do it inside a controller ... but it didn''t worked out ... > > I create a file inside the view/myTest folder ... put inside the code > > ... but nothing again... > > It gives to me Application Error... > > How can I solve it ... where have I to insert the require ''rexml/ > > document'' ...?? > > > This should go in conifg/environment.rb, however the example of rexml > was a bad one since it is required by default already with Rails. > > To test this, go to ./script/console and type REXML::Document.new > > -Lucas > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
How are you invoking REXML calls? Are you specifying the module explicitly or have you used ruby''s include semantic to make your life simpler in your command line application? What do your log files/traces say about the error? The rexml methods are in the rexml module. I doubt that module is included in rails, so this could be your problem. Try <%=REXML.inspect%> or <%=REXML.methods%> in a view to see if it''s how you expect. If you''re also new to ruby, make sure you understand what require and include mean in the language. Particularly, include is semantically much different than the include keyword in other languages. As for Ajax, read the prototype.js source (in public/javascripts), and look at the documentation for link_to_remote and form_tag_remote (and everything else in the http://api.rubyonrails.com/classes/ActionView/Helpers/JavaScriptHelper.html doc). link_to_remote is probably the one you''ll use the most and it''s very flexible. Also make sure you understand partials, component rendering, etc. Good luck. If you can give us more information about your rexml errors, perhaps we can be of help. Make sure your environment is set to development and look in log/development.log for errors if they''re not showing up in the browser. Stack traces are usually very easy for us to unravel. Brian On 8/7/05, Gioachino Bartolotta <gioachino.bartolotta-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi Lucas ... > I understood, but why it doesn''t work when I try to open an xml file ...? > I used REXML to process files from console... but if I try from RoR it > gives me Application Error... on the error log it says bad header and > gives me the first node of xml file ....? > Is there a way to proceed?? Another question ... where I can find > documentation about RoR and ajax?? > > Thanks ... > -- > ------------------------------------------- > Gioachino Bartolotta > ICQ #: 9103167 > MSN Messenger: astraroth-06ZeP6ie+xM@public.gmane.org > Yahoo & Skype: gioachino_bartolotta > > > 2005/8/6, Lucas Carlson <rails-1eRuzFDw/cg@public.gmane.org>: > > > I would like to load ... by example ... the rexml class. > > > I tried to do it inside a controller ... but it didn''t worked out ... > > > I create a file inside the view/myTest folder ... put inside the code > > > ... but nothing again... > > > It gives to me Application Error... > > > How can I solve it ... where have I to insert the require ''rexml/ > > > document'' ...?? > > > > > > This should go in conifg/environment.rb, however the example of rexml > > was a bad one since it is required by default already with Rails. > > > > To test this, go to ./script/console and type REXML::Document.new > > > > -Lucas > > > > _______________________________________________ > > Rails mailing list > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- The years ahead pick up their dark bags. They move closer. There''s a slight rise in the silence then nothing. -- (If you''re receiving this in response to mail sent to bluczkie-OM76b2Iv3yLQjUSlxSEPGw@public.gmane.org, don''t be concerned This is my new address, but mail will be forwarded here indefinitely)
Hi Brian! I discovered that on my kubuntu system, I wasn''t having a link to erb and irb .. they were called erb1.8 and irb1.8 ... I did now a symlink to them and everything seems to work fine now... Thank you for help about ajax. I will see the prototype.js I am not new on ruby, I used it sometimes for simple applications, especially if I have to manipulate xml files (with rexml)... but I am quite new to RoR ... :D but I like it .. :) Thanks for help -- ------------------------------------------- Gioachino Bartolotta ICQ #: 9103167 MSN Messenger: astraroth-06ZeP6ie+xM@public.gmane.org Yahoo & Skype: gioachino_bartolotta 2005/8/7, Brian L. <zorander-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:> As for Ajax, read the prototype.js source (in public/javascripts), and > look at the documentation for link_to_remote and form_tag_remote (and > everything else in the > http://api.rubyonrails.com/classes/ActionView/Helpers/JavaScriptHelper.html > doc). link_to_remote is probably the one you''ll use the most and it''s > very flexible. Also make sure you understand partials, component > rendering, etc.