about 5 months ago - No comments
If you haven’t installed ruby, follow this post Part 1: Installation and Configuration (Rails and Passenger) 1. Upgrade existing ruby gems sudo gem list sudo gem update –system UPDATE: Took me 4 hours figuring this out. There was a problem when i run script/console that it will say the “gem” detected was 1.0.1 although the
about 1 year ago - No comments
In summary, install Oracle Instant Client and try to run sqlplus. If sqlplus connects to the oracle sid then go ahead and install the rails adapters for oracle. What is important to note here, is to install the oracle-instantclient for the architecture of your machine.. I have tested this on Debian Lenny (i386) and CentOS5
about 1 year ago - 1 comment
1. Read http://www.foliosus.com/2008/05/05/connecting-ruby-on-rails-to-oracle-on-an-intel-mac-in-leopard-take-2/ 2. Install Oracle Instant Client on Mac. a. Instant Client Package – Basic: All files required to run OCI, OCCI, and JDBC-OCI applications – instantclient-basic-macosx-10.2.0.4.0.zip (34,020,719 bytes) b. *Instant Client Package – SDK: Additional header files and an example makefile for developing Oracle applications with Instant Client instantclient-sdk-macosx-10.2.0.4.0.zip (603,493 bytes) OR download
about 1 year ago - No comments
Here is a brief outline on how I am doing test driven development personally. 1. Code up tests/functional/foo_controller_test.rb until you know what you expect from the method. Make the test method as self explanatory as much as possible. def test_goto_restaurant_next end 2. Imagine how the URL parameters will be passed to the controller. get :goto,
about 1 year ago - No comments
This post should have made it a looong time ago.. I am currently building an application where all the output formats is in XML. One of the first problems I had was to output the xml. 1. At first try, I could append ‘xml’ in the routes as a format parameter. But this takes into
about 1 year ago - No comments
1. I was trying to get the http headers dump from a mobile phone. So I quickly dump it in a log file to see its contents.. headers[’Content-Type’] = ‘text/xml; charset=utf-8′ for header in request.env.select {|k,v| k.match("^HTTP.*")} logger.info(header[0].split(’_',2)[1] + ":" + header[1]) end Reference: http://tonycode.com/wiki/index.php?title=Dumping_HTTP_Headers 2. However, please note that you can actually see everything
about 1 year ago - No comments
Taken from http://guides.rails.info/testing_rails_applications.html The get method kicks off the web request and populates the results into the response. It accepts 4 arguments: *The action of the controller you are requesting. This can be in the form of a string or a symbol. *An optional hash of request parameters to pass into the action (eg. query
about 1 year ago - No comments
If you want user_id to be ‘nil’, then omit it from your fixtures. I tried setting user_id: nil before, and it turned out to be ’0′ in the database. # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html <% u = UserLogin.create( :password => ‘foo’) %> <% u.password=(’password’) %> user_no_profile: email: noprofile@yahoo.com admin: false user_id: nil salt:
about 1 year ago - No comments
Wow.. everyday.. Ruby on Rails seems to amuse me.. I just figured how to seperate layouts just by having different files in the layouts/ which corresponds to a controller. If a layout file “home (home.html.erb)” exists and there is home_controller, then the home_controller would use that layout instead of application.html.erb. Now.. I haven’t validated this
about 1 year ago - No comments
1. Install GIT from http://code.google.com/p/git-osx-installer/ 2. http://josevalim.blogspot.com/2008/05/footnotes-v30.html – Jose Valim is now maintaining footnotes 3. How to install? cd myapp/vendor/plugins git clone git://github.com/drnic/rails-footnotes.git footnotes rm -rf footnotes/.git In summary, you are better off installing the plugin from GIT instead of SVN if you are using rails 2.1.x or edge ( at the time this post