Welcome To Snipplr


Everyone's Recent Snippets Tagged rails



« Prev 1 2 3 4 5 6 7
Useful for building nested entries checkboxes etc
0 3382 posted 11 years ago by davidb
Aliases command "go!" to starting AND restarting rails server for a project from anywhere in the filesystem. Replace PROJECT_HOME with the path to your project. Place in config.fish
0 1402 posted 11 years ago by Epigene
A very concise ruby on rails helper method that converts seconds into human readable format. It will not display any time periods that have 0 (ie: 1 hour 13 seconds - skipping minutes as there were none) Due to complexity, months were not factored...
0 2953 posted 11 years ago by uberdragon
I had a spreadsheet with a ton of data on it that I wanted in my seeds file. Using example columns in your database titled db_column1, db_column2, db_column3. Place your .xls file into your public folder and run 'gem install roo'
0 3446 posted 11 years ago by asalgan
You want to start a new Rails app. But you also want to start a new RVM gemset for the app so you can start with the latest Rails and gems. In this code snippet I show how I start off an up-to-date Rails project in a clean gemset.
1 3687 posted 12 years ago by dreamstarter
If you're using Rails and want to make this a global function, drop this into your application_controller and call it as a function. Example: # get_string_between("hellomyfriendmoto", 'o', 'm') # > myfriend
0 4004 posted 12 years ago by joshmn
Supported brands name | key ----------------------- American Express | :amex China UnionPay | :unionpay Diners Club | :diners Dinner Club US | :diners_us Discover | :discover...
0 4675 posted 12 years ago by Fivell
Working on the problem described here: http://forums.att.com/t5/Data-Messaging-Features-Internet/3G-proxy-wnsnet-attws-com-strips-HTTP-response-headers/m-p/3294533/highlight/false#M59737 After some testing we found the below code to fix our troubl...
0 3609 posted 12 years ago by mightybs
= Rake Task for Rails * name: name of the task * desc: description of the task
0 3529 posted 13 years ago by cliffbraton
Esto suele ocurrer muy amenudo cuando instalamos Ruby on Rails antes que MySQL. Es un error "Library not loaded: libmysqlclient.18.dylib (LoadError)" donde lista los directorios donde busca y no lo encuentra. La solución es guiarle para que lo encue...
0 3484 posted 13 years ago by skozz
An example method for fetching remote JSON data in Ruby.
2 3798 posted 14 years ago by vestimir
0 3322 posted 14 years ago by guhelouis
0 3381 posted 14 years ago by abstraktor
0 3475 posted 14 years ago by avioli
Data Types for DB, MySQL, SQLite, PHP, Ruby, Rails, JS, etc. because I forget them sometimes from Ruby on Rails Guides: Migrations http://bit.ly/hFWjT0 from Rails Migrations http://bit.ly/hI5zpz
0 1700 posted 14 years ago by brandonjp
Ruby / Rails - A refresher reference for me because I forget how to do this... create project generate scaffold scaffolding migrate db start server
0 1910 posted 14 years ago by brandonjp
links (full <a href="#"> element) to Show Edit Destroy Delete records in view *.erb must be in the record loop:
0 3039 posted 14 years ago by brandonjp
if then statement... in a view file *.html.erb:
0 2435 posted 14 years ago by brandonjp
If each title is unique and you need alphabetical, try this in your Post model. You can change title to any unique attribute (created_at, id, etc.) if you need a different sort order.
0 3330 posted 15 years ago by gmericksen
0 1648 posted 15 years ago by batamire
This will require a user to log back in if they are inactive for more than 10 minutes. In order for this feature to be used you must have a last_request_at datetime column in your table for whatever model you are authenticating with.
0 1606 posted 15 years ago by gmericksen
0 1309 posted 15 years ago by stayce
0 3356 posted 15 years ago by alx_g
1 1478 posted 15 years ago by nhocki
tag links with .click function
0 3293 posted 15 years ago by insanedreamer
« Prev 1 2 3 4 5 6 7