Tag Archives: Postaday2011

Rails – RSpec Test with Devise

According to the documentation in the Devise home page, we can use the following before_filter to control the user access on specific controller functions.

before_filter :authenticate_user!

 

But when i try to test the controller function in RSpec, i got the following error.
Failure/Error: post :create
undefined method `authenticate!’ for nil:NilClass
Continue reading Rails – RSpec Test with Devise

Rails – Add Custom Fields to Devise User Model

Previous related posts:

By default, the users table in Devise only contains the email and password fields in user profile. Most likely we need to add our custom fields such that we can store more user information. The following steps show you how to add a username field in the users model. Continue reading Rails – Add Custom Fields to Devise User Model

子華文集 – 棟篤屁 之 荃灣

棟篤屁之荃灣

上次提倡港人游港,本人身體力行,立刻便揀了一個我從來都不會去的地方大逛一番。由於那區實在太過陌生,在出發之前,匆忙中找了一個朋友做嚮導,再一次實踐了我其中的一個做人座右銘:沒長進的人在家靠父母,沒膽量的人出外靠朋友。
  
不是開玩笑,對於我來說,那地方的陌生感,和印度沒有分別。不,除了語言之外,我好像對印度還要熟悉些。
  
那地方說出來你可能會認為很荒謬,一個香港人,生於斯長於斯投票投於斯,竟然對一個耳熟能詳的地方可以如此無知。喂,不要笑我,如果你不是住在那裏或做地產,你一生不到那裏也是毫無損失。那地方,叫做荃灣。
  
我問朋友,荃灣有什麼好玩的地方?
  
沒有。 Continue reading 子華文集 – 棟篤屁 之 荃灣

Drupal – Override the php.ini

I was working for a Drupal website which i wanted to increase its maximum file upload size. This value is determined by the php.ini configuration file.

Unfortunately, the server hosting does not provide the SSH access so i can’t edit the php.ini. Therefore i have to let Drupal override the php.ini settings. There is 2 ways for Drupal to override the php.ini settings. Continue reading Drupal – Override the php.ini

Drupal – Style Rendering problem of TinyMCE Editor in WYSIWYG

The WYSIWYG module works with lots of rich text editors such as TinyMCE, FCKeditor, CKEditor … etc. I downloaded the TinyMCE library and enable it in the WYSIWYG profile. After enabling the all available buttons in the rich text editor, i found that the style cannot be rendered correctly. All styled text are rendered without CSS style but attributes in square brackets []. Continue reading Drupal – Style Rendering problem of TinyMCE Editor in WYSIWYG