Automatically build the Passenger Apache module, without interactively asking for user input.
passenger-install-apache2-module --auto
Related cards:
How to build the perfect number of blank records for a nested form
When you render a nested form for a Movie
which has_many :actors
, you want to render the right number of blank Actor
forms. The right number means:
- A minimum number of blank forms so the user can add more
Actors
to an existingMovie
, ...
Chromedriver issue #4550 breaks the user agent for device emulation via device name
Newest versions of Chromedriver breaks the user agent for device emulation via device name. In previous versions the user agent of the emulated device was set. In the newest versions the user agent differs from the emulated device.
- Version Chro...
Security issues with hash conditions in Rails 2 and Rails 3
Find conditions for scopes can be given either as an array (:conditions => ['state = ?', 'draft']
) or a hash (:conditions => { 'state' => 'draft' }
). The later is nicer to read, but has horrible security implications in some versions of Ru...
Best Practice: Creating User Accounts Without Sending the Password
In applications without a sign-up, user accounts are usually created by an admin. This imposes two challenges:
- How to transmit the password securely and
- How to make the user change the initial password immediately
There is a simple solution:...
How to: Build a "generic observer" widget for the awesome window manager
If you want a widget for awesome that runs a command regularly (every X seconds) and puts the output into your awesome panel, this is for you.
Put the code below into your ~/.config/awesome/rc.lua
. It supplies tw...
Using Passenger Standalone for development
For our production servers we use Passenger as a Ruby application server. While it is possible to use Passenger for development as an Apache module, the in...
Use form_for without the enclosing form tag
In rare cases you might need something like form_for
(for using form builder methods on the resulting block element) but without the surrounding form. One such case would be upda...
Rails: Talking to the database without instantiating ActiveRecord objects
Instantiating ActiveRecord objects comes expensive. To speed up things, you can choose a more direct way to talk to your database: the [ActiveRecord::ConnectionAdapters::DatabaseStatements
](http://api.rubyonrails.org/classes/ActiveRecord/Connect...
Fix LoadError with Rails 3 applications on Passenger
After switching to Rails 3 you may get a LoadError
with the following message when trying to use your application via passenger:
no such file to load -- dispatcher
Your Passenger version is most likely out of date.
Update the gem, then ins...
Sanitize filename with user input
If you have to build a filename (e.g. for use in downloads) that contains user input, keep in mind that malicious input might come from users and could lead to security problems.
Instead of blacklisting characters such as / , . \ ´
etc. better ...