This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
如果系统是ubuntu12,系统默认自带Postgresql9.1,首先我们把它删除了! | |
步骤: | |
1、列出关于postgre9.1的包 | |
dpkg -l | grep postgres | |
如果是9.1,下面列表的8.3就是9.1,有一些包可能没有,是系统而定。 | |
ii postgresql 8.3.17-0ubuntu0.8.04.1 object-relational SQL database (latest versi | |
ii postgresql-8.3 8.3.9-0ubuntu8.04 object-relational SQL database, version 8.3 | |
ii postgresql-client 8.3.9-0ubuntu8.04 front-end programs for PostgreSQL (latest ve | |
ii postgresql-client-8.3 8.3.9-0ubuntu8.04 front-end programs for PostgreSQL 8.3 | |
ii postgresql-client-common 87ubuntu2 manager for multiple PostgreSQL client versi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### | |
Unobtrusive JavaScript solution for polling in a Rails application | |
Introduction: | |
Add a polling-placeholder wrapper div to any partial and add a data attribute | |
named poll that should be equal to "true" until you want to stop polling. | |
The default polling frequency will be used unless you provide an "interval" data | |
attribute which should be the number of milliseconds to use for the interval. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Model | |
@user.should have(1).error_on(:username) # Checks whether there is an error in username | |
@user.errors[:username].should include("can't be blank") # check for the error message | |
#Rendering | |
response.should render_template(:index) | |
#Redirecting | |
response.should redirect_to(movies_path) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |