Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- THis is the update controller:
- def update
- @ad = Ad.find(params[:id])
- @ad.update_attributes(:id =>params)
- redirect_to "/ads/#{ @ad.id }"
- end
- and this is the security controller:
- before_filter :check_logged_in, :only=> [:edit, :update, :destroy]
- private
- def check_logged_in
- authenticate_or_request_with_http_basic("Ads") do |username, password|
- username == "admin" && password == "password"
- end
- end
Add Comment
Please, Sign In to add comment