In Rails 2.x
script/generate controller [new controller name] [page you want create]
[code]script/generate controller search index[/code]
In Rails 3.x
[code]rails generate controller search index[/code]
In Rails 2.x
script/generate controller [new controller name] [page you want create]
[code]script/generate controller search index[/code]
In Rails 3.x
[code]rails generate controller search index[/code]
Cut and past php code to determine if it is the wordpress blog home page (and only the home page itself).
[php]<?php if (is_home() && !is_paged()): ?>[/php]
Example, to print john if it is a “homepage” templated page and jill otherwise:
[php]<?php if (is_home(); ?>
<?php
if($name == ‘john’){
echo ‘Hi John’;
}else if($name == ‘jill’){
echo ‘Hi Jill’;
}else{
echo ‘Hi’;
}
?>[/php]
for Rails 2.*
Not for Rails 3
[ruby]./script/generate resource article[/ruby]
[ruby]./script/generate migration add_join_table_for_articles_and_authors[/ruby]
Update to the routes file should be taken care of by generate resource, but might want to check).