Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

How do I setup Ruby on Rails to use XML/web pages as the database?

Posted on 2006-04-21
5
Medium Priority
?
325 Views
Last Modified: 2012-06-27
Hi.

I'm using ruby on rails for a web application that will take text from a xml-web page, parse it, and return it to the user as a formatted file. I only need read access to the xml, not write. How do I setup a ruby on rails application so that, rather than the default settings for mysql, it knows to look at the xml web page?

I know this is possible in php, python, etc., but I'd like to use rails, as I'm most familiar withit.

Specifically, I will be taking text from wikitravel.org, and the xml page (for example) is http://wikitravel.org/en/Special:Export/Turkey
0
Comment
Question by:stoniergrunow
  • 3
  • 2
5 Comments
 
LVL 3

Accepted Solution

by:
evangineerX earned 1500 total points
ID: 16517120
Use REXML.

You can find some REXML tutorials at:
http://www.xml.com/pub/a/2005/11/09/rexml-processing-xml-in-ruby.html
http://www.germane-software.com/software/rexml/docs/tutorial.html

An article that addresses a similar project to what you describe can be found at:
http://www.xml.com/pub/a/2005/11/02/rest-on-rails.html
0
 
LVL 3

Assisted Solution

by:evangineerX
evangineerX earned 1500 total points
ID: 16517164
0
 

Author Comment

by:stoniergrunow
ID: 16530836
OK - I looked at the links, but I was specifically wondering how I write the /config/database.yml file. Normally it looks something like:

development:
  adapter: mysql
  database: depot_development
  username: user
  password:
  host: localhost

Is it just a matter of substituting an xml adapter? Or do I leave this file untouched, and use something else to interact with the XML?
0
 
LVL 3

Expert Comment

by:evangineerX
ID: 16531057
Use something else to interact with the XML.  Take a closer look at the Rest on Rails and Accepting XML articles
0
 

Author Comment

by:stoniergrunow
ID: 16538594
Hmmm - I was hoping to use the yml file, but that's apparently a limitation of ruby.
0

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
Over time, the online landscape has altered considerably, but that’s nothing compared to the up-and-coming trends that will shape the web design industry in the coming year. Keep reading to find out which trends will shape B2B web design in 2018.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…
Suggested Courses
Course of the Month13 days, 4 hours left to enroll

578 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question