21 Recent Entries tagged with »Rails«
I was asked how to get the body of an HTTP post request in a Rails controller. And with the most things in Rails it's very easy.
...
I'm using the very convenient RSpec Rails plugin.
From the Rspec website:
RSpec is a framework for practicing Behaviour Driven Development (BDD) in Ruby.
You can find more information on...
Running attachr.com for quite a while i noticed that the email service (you can send an email to save@attachr.com to save a code snippet) became target for spam mails.
I decided to install spam...
./script/generate model MediaFile --svn
creates your model and test files. The generated files are automatically added to your Subversion repository (after commit).
exists app/models/...
Dispatcher.reset_application! reloads your model while running script/console.
stefan@www:~$ ./script/console
Loading development environment.
>> ...
[...]
>> Dispatcher.reset_application!
...
This is a MANDATORY upgrade for anyone not running on a very recent edge (which isn't affected by this). If you have a public Rails site, you MUST upgrade to Rails 1.1.5. The security issue is sev...
Using the most recent version of Rails the rdoc rake task fails on my windows test box.
A quick and simple hack enables the rdoc task.
Replace:
Rake::RDocTask.new("appdoc") { ...
Do you use Capistrano to deploy your Rails app?
Capistrano uses subversion to deploy rails applications. Unfortunately this means that the hidden subversion directories (usually .svn) are acces...
Small shell script to restart lighttpd. The script kills all dispatch.fcgi processes and restarts the webserver.
See: http://weblog.textdrive.com/article/185/happy-thanksgiving-daedalus-is-for-dinner, http://weblog.textdrive.com/article/178/fun and http://forum.textdrive.com/viewtopic.php?id=7081 for further information.
As soon as you deploy a rails app on the production server you should consider to "freeze" your Rails. That means to put the Rails framework in a subdirectory (vendor/rails) of your application.
Problems installing the Ruby mysql gem?
[sts@powerbook mysql-2.7]$ sudo gem install mysql
[...]
ERROR: Failed to build gem native extension.
[sts@powerbook mysql-2.7]$ cd /usr/local/li...
If you don't want to name your asset directories for javascript files and stylesheets "javascripts" and "stylesheets" here is how you can change the default path settings.
[1] http://weblog.textdrive.com/article/31/ having-ones-own-lighttpd-and-running-it-too
[2] http://lighttpd.net/
[3] http://weblog.0x7b.com/articles/2005/09/17/lighttpd-setup-on-textdrive-co...
newsyslog is a highly configurable program for managing and archiving log files.
/usr/sbin/newsyslog -r -f /home/sts/etc/newsyslog.conf
Ausgabe des Outputs ohne die Logfiles zu bearbe...
class ApplicationController < ActionController::Base
before_filter :set_default_content_type
def set_content_type(content_type)
@response.headers["Content-Type"] = ...
The following command will install all packages and libraries with "ruby1.8" in the package name, which should lead to a more or less complete installation of ruby on your machine:
apt-...
ruby -v
[powermac:~] sts% ruby -v
ruby 1.8.2 (2004-12-25) [powerpc-darwin8.0]
Readline installieren
curl ftp://ftp.gnu.org/gnu/readline/readline-5.0.tar.gz | tar xfz
cd readline-5.0
....
ruby -v
[powermac:~] sts% ruby -v
ruby 1.8.2 (2004-12-25) [powerpc-darwin8.0]
Readline installieren
curl ftp://ftp.gnu.org/gnu/readline/readline-5.0.tar.gz | tar xfz
cd readline-5.0
....
Using Apache as a proxy to serve a Rails on lighttpd application
<Virtualhost xxx.xxx.xxx.xxx>
ServerAdmin s@example.com
ServerName rails.juretta.net
Serv...