-
Rails Heroku Database Population - Stack Overflow
heroku db:push -t pages
@B Seven: heroku help db:push will tell you how
-
-
Sirupsen and his codeabouts
Sirupsen
Simon Hørup Eskildsen
sirup@sirupsen.com
@SirupsenSirupsen
Simon Hørup Eskildsen
sirup@sirupsen.comDeveloper, rubyist, and student building amazing things in Ruby.
Github
Twitter
Pinboard
Google Talk
SkypeGet started right with RVM
-
Rails on Edge: Begin Rescue Else End
def deptname begin dept = Department.find(thisdept) rescue "No Department" else dept.name end end
-
-
-
-
Send Email Using Rails
ActionMailer::Base.server_settings = {
:address => "smtp.tutorialspoint.com",
:port => 25,
:domain => "tutorialspoint.com",
:authentication => :login,
:user_name => "username",
:password => "password",
} -
-
LSST v1.05r3 > Chapter 2 > How to write shell script
How to write shell scriptFollowing steps are required to write shell script:(1) Use any editor like vi or mcedit to write shell script.(2) After writing shell script set execute permission for your script as follows syntax: chmod permission your-script-nameExamples:$ chmod +x your-script-name $ chmod 755 your-script-name
-
pagination with find_by_sql using will_paginate :: Senior & Expert RoR Developers Discussion Forum by Nyros Technologies
find_by_sql
<Model Name>.paginate_by_sql ["sql query"], :page => params[:page], :per_page => 20
-
-
aagh.net :: Projects :: Ruby PHP Serializer
A Ruby module providing equivilents of PHP's
serialize() and
unserialize() functions. -
RDoc Documentation
php_serialize.rb
Path:
lib/php_serialize.rbLast Update:
Wed Apr 01 20:52:09 +0100 2009 -
-
-
Searching for Dates - Thinking Sphinx | Google Groups
# Search Date range
if !params[:pub_date][:start].blank? && !params[:pub_date]
[:start].blank?
start_date = params[:pub_date][:start].to_i
end_date = params[:pub_date][:end].to_time.advance(:days =>
1).to_i
conditions[:pub_date] = start_date..end_date
end
Project.search :include => :data,
:conditions => conditions,
:page => params[:page] || 1,
:order => "title asc",
:per_page => 10,
:match_mode => :extended -
Searching § Thinking Sphinx
Attribute Filters
Filters on attributes can be defined using a similar syntax, but using the :with option.
Article.search 'pancakes', :with => {:author_id => @pat.id}Filters have the advantage over focusing on specific fields in that they accept arrays and ranges:
Article.search 'pancakes', :with => {
:created_at => 1.week.ago..Time.now,
:author_id => @fab_four.collect { |author| author.id }
}And of course, you can mix and match global terms, field-specific terms, and filters:
Article.search 'pancakes',
:conditions => {:subject => 'tasty'},
:with => {:created_at => 1.week.ago..Time.now}If you wish to exclude specific attribute values, then you can specify them using :without:
Article.search 'pancakes',
:without => {:user_id => current_user.id}For matching multiple values in a multi-value attribute, :with doesn’t quite do what you want. Give :with_all a try instead:
Article.search 'pancakes',
:with_all => {:tag_ids => @tags.collect(&:id)} -
19 Rails Tricks Most Rails Coders Don’t Know
Separate out slices of functionality into Engines - Everyone's heard of Rails' plugins, but pitifully few are using Rails Engines! Rails Engines are like plugins on steroids. They can contain their own models, controllers, and views, and integrate with any applications you run them under. This allows you to split out common fragments of functionality (login, user management, content management, etc.) into separate 'engines' to use in your different projects within minutes. No more writing dull login code! Rails Engines is a big deal, but it should be a far bigger deal.
-
XML.com: Putting REST on Rails
Only the Beginning
So now we have a simple RESTful Rails application with a full test suite and HTTP method dispatching. We used the HTTP OPTIONS method to identify the methods each resource supports, and we based our test cases around a relatively simple RESTful protocol.
