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
# Recursively add a .gitignore file to all directories | |
# in the working directory which are empty and don't | |
# start with a dot. Helpful for tracking empty dirs | |
# in a git repository. | |
for i in $(find . -type d -regex ``./[^.].*'' -empty); do touch $i"/.gitignore"; done; |
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
# I always forget how easy this is... assuming r202 was the bad commit | |
# I just merge the *reverse* difference between r202 and r201 | |
svn merge -r 202:201 http://svn.example.com/acme/trunk | |
svn diff # check it's right | |
svn ci -m "reversed out r202" | |
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
<% semantic_form_for @user do |form| %> | |
<%= form.inputs :title, :body, :section_id, :created_at %> | |
<%= form.buttons :commit %> | |
<% end %> |
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
speechless:~/dev $ rails formtastic_test | |
create | |
create app/controllers | |
create app/helpers | |
... trimmed by JF | |
speechless:~/dev $ cd formtastic_test/ | |
speechless:~/dev/formtastic_test $ ./script/plugin install git://github.com/justinfrench/formtastic.git | |
Initialized empty Git repository in .git/ | |
warning: no common commits | |
remote: Counting objects: 26, done. |
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
# 1. add this to formtastic_spec.rb inside the ":as => :select" describe block | |
it 'should have one option with a "selected" attribute' do | |
output_buffer.should have_tag('form li select option[@selected]', :count => 2) # the 2 is intentional | |
end | |
# 2. run the specs | |
expected | |
<form class="formtastic post" action="/posts" method="post" id="new_post"><li class="select optional" id="post_author_id_input"><label for="post_author_id">Author</label><select name="post[author_id]" id="post_author_id"><option value="37">Fred Smith</option> |
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
# http://rpheath.com/posts/409-rails-time-date-formatting-with-lambda | |
Time::DATE_FORMATS.merge!( | |
:friendly => lambda { |time| | |
if time.year == Time.now.year | |
time.strftime "%b #{time.day.ordinalize}" | |
else | |
time.strftime "%b #{time.day.ordinalize}, %Y" | |
end | |
} |
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
Parameters: { | |
"commit"=>"Create Post", | |
"post"=>{ | |
"thing_attributes"=>{ | |
"name"=>"sdfgsdf", | |
"about"=>"sdfg" | |
}, | |
"body"=>"sdfgsdg", | |
"title"=>"sdfgsdg", | |
"published"=>"0"}, |
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
# renders a post[author_attributes][login] | |
form_for(@new_post) do |post| | |
post.fields_for(:author) do |author| | |
concat(author.text_field(:login)) | |
end | |
end | |
# renders a post[author][login] | |
form_for(@new_post) do |post| | |
post.fields_for(@new_post.author) do |author| |
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
Rails CMS alternatives | |
====================== | |
Note: project activity was checked on 11/26/09. | |
Active projects: | |
--------------- | |
adva-cms | |
repo: http://github.com/svenfuchs/adva_cms/ | |
site: http://adva-cms.org/ | |
Last update: 11/24/09 |
OlderNewer