4/14/2009

FocusGroup1

1. Share my encountered problem and soluton during use of Ruby and Rails.

a.) ERROR 1045 (28000): Access denied for user
'-root'@'localhost' (using password:NO)
When the web application connect to mysql database, it prompts out an error "ERROR 1045 (28000): Access denied for user
'-root'@'localhost' (using password:NO)"

Solution: Use phpmyadmin to change the root password.

b.) Undefined method 'scaffold' for TaxiController:Class
When i am using scaffold in my Taxi Controller [scaffold :taxi]]to dynamic generate the web application, i encounter an issue that is undefined method 'scaffold' for Taxicontroller:class.

Solution: Install the scaffolding plugin by issuing the command "plugin install scaffolding"

c.) Undefined method 'paginate' for #
TaxiController
After i have successfully installed the scaffold plugin, i re-run the taxi web application in the browser, i encounter an issue that is undefined method 'paginate' for # TaxiController

so, i search the plugin from web in order to install that plugin...But..
after issuing the command : ruby script/plugin install
http://tools.assembla.com/svn/breakout/breakout/vender/plugins/classic_pagination,
that plugin still does not install properly as the classic_pagination in taxiapp\vendor\plugins\classic_pagination is an empty directory.

Solution: Download classic_pagination plugin in my pc and extract it in
"vendor\plugins\classic_pagination" under the taxi web application.


d.) Web application interface design issue
It is difficult for us to build up a professional interface within a limited time using html editor.

Solution: Download a dreamweaver plugin named rubyweaver in order to let dreameaver support rhtml format from http://rubyweaver.gilluminate.com/download.

e.) Time is in long format after querying from mysql
Background: In workshop 3, I define a column named time_required in mysql with the datatype that is time, when i use ruby to get resultset of that records, i find that the time_required value is in long time format like "Sat Jan 01 02:05:40 +0800 2000"

Solution: use strftime to get the hour and minute in order to control the timeformat, for example, passenger.time_required.strftime("%I:%M%p")

f.) JobID does not be auto-increment during the table altering.

Backgroud: In workshop 3, I need to create JobID with auto-increment manner, when i alter that column attribute, mysql does not allow JobID being auto-increment, it is because the column named ID already be auto- increment, it does not allow 1 table having 2 columns that is using auto-increment.

Solution: Create a JobID generator which will automatically plus one after getting the last recordset of JOBID, for example

@getResultSetJobID = Passenger.find(:all).last.job_id

@newJobID = @getResultSetJobID+1

1 則留言:

  1. Guys,

    You are moving very fast or maybe I am too behind. I need to do a lot to catch up. Thank you for posting the problems on the blog. I can therefore refer to your solutions.

    Ernest

    回覆刪除