How does this look when you have fields in both objects? How do create from a single form? For example, I want to track two different expense types: reimbursements and donations.
Reimbursements have a description, donations have name, address, etc., but both have an amount, a receipt, a category, and belong to an account.
I'm trying the polymorphic association approach, but having trouble figuring out how to create a new reimbursement/entry with all the necessary data and associated objects.
How would I make HTTP basic authentication conditional? For example, I have a staging server at work, and I only want to make people authenticate if they access the server from outside the local network.
With this, I am always prompted to authenticate—even if needs_authentication? explicitly returns false. Moving http_basic_authenticate_with inside a method doesn't seem to work, either—I get an undefined method error.
How does this look when you have fields in both objects? How do create from a single form? For example, I want to track two different expense types: reimbursements and donations.
Reimbursements have a description, donations have name, address, etc., but both have an amount, a receipt, a category, and belong to an account.
I'm trying the polymorphic association approach, but having trouble figuring out how to create a new reimbursement/entry with all the necessary data and associated objects.
One answer: pull
unicorn_init.sh
out of source control and put it in the#{shared_path}/config/
directory and symlink to it likedatabase.yml
.How would you deploy to multiple stage environments with your unicorn configuration? Specifically, how to you change:
to
when you run
cap staging deploy
orcap production deploy
, respectively?I found the answer back in episode #82:
How would I make HTTP basic authentication conditional? For example, I have a staging server at work, and I only want to make people authenticate if they access the server from outside the local network.
With this, I am always prompted to authenticate—even if
needs_authentication?
explicitly returns false. Movinghttp_basic_authenticate_with
inside a method doesn't seem to work, either—I get anundefined method
error.Short answer (via jquery.com) is: PUT and DELETE are not supported by all browsers.
It's more convenient to go with POST.
What other considerations should be taken into account to use the PUT method, instead of POST? Is it as simple as changing the method name?