Extending Rails Form Builders
Extending forms in Rails is simple and will greatly reduce the amount of code in your views. This example is taken right from the Agile Web Development book on Rails(2.1.*) with one minor tweak. I want to pass a label argument along with the field name so...
Written by Sean Behan on 06/17/2012
Nested Attributes in a Form for Has_One Model Association in Rails
Just for reference...
class Member < ActiveRecord::Base
has_one :member_profile
accepts_nested_attributes_for :member_profile
end
...
Written by Sean Behan on 06/17/2012
Recursively Search Contents of a File with Grep
The -r flag is for recursive, meaning it will also look in sub directories. The -i flag is for case insensitivity, meaning WORD and word will both be found.
grep -ir "search term" directory/path
Written by Sean Behan on 08/29/2013
PHP Headers for Sending CSV File Downloads
If you would like to force a file download prompt to the user, instead of just outputting the text to the browser, use the following headers.
...
Written by Sean Behan on 11/25/2017
How to Tag and Push a Release with Git
Set the `-a` and the `-m` flags like so
git tag -a v1.0.0 -m "Note about the release goes here"
Then to push the tag to a repository
git push origin --tags
And that's it!
Here are the docs [https://git-scm.com/book/en/v2/Git-Basics-Tag...
Written by Sean Behan on 11/29/2017