text:
"The two officers who fatally shot an unarmed African American college student in Pasadena last weekend are veteran members of the force with no previous record of shooting anyone, authorities said.
Pasadena Police Chief Phillip Sanchez confirmed that Officers Jeffrey Newlen and Mathew Griffin shot Kendrec McDade, 19, on a dark, narrow street last weekend. Sanchez said the only notable incident in their records was Griffin's shooting of a Rottweiler in 2007.
The incident, involving two white officers, has sparked tensions in a community with a long history of divisive relations between the Police Department and African American community.
McDade, 19, was fatally shot shortly after 11 p.m. on March 24 by two officers after they said they saw his hand near his waistband. The officers shot him because they mistakenly believed he had a gun after a theft victim called 911 and lied to dispatchers.
The caller, Oscar Carrillo, told police he had been robbed of his backpack and laptop by two armed men. Police arrested him on suspicion of involuntary manslaughter Wednesday, saying that he deliberately misled authorities in a lie that contributed to the fatal shooting.
Sanchez released the names in a statement under mounting pressure Friday as he prepared for a public forum Saturday at a northwest Pasadena church to try to calm concerns.
Newlen joined the department in 2007 and Griffin joined in 2006.
Their names and backgrounds were made public after The Times and Pasadena Star-News identified them based on police records.
Carree Harper, an attorney for the McDade family, has questioned the police account of the events." [More here]
Noooo! You mean the police could have misrepresented the facts surrounding what happened?
We probably won't be hearing the name of Kendric McDade like we have been hearing the name of Trayvon Martin for the next few weeks, because the police chief in Pasadena, California, unlike the clowns who run the Sanford, Florida police department, have been more proactive and forthright with how they are handling this case. Sadly, though, another young life is lost. And the perils of being a young black male in our country continues to play itself out for us all to see. If some Charles Bronson wannabe neighborhood watch captain doesn't get you; some over zealous color aroused police officer will. (Hell even white women are getting into the act. h/t Nancy Lockhart.) And, to make matters worse, other young black males who don't value your life (or their own) will also take you out.
Anyway, it's not only young black males who are getting slaughtered here in A-merry-ca; old ones are catching bullets as well. Let's not forget about the case of
Kenneth Chamberlain, Sr., the White Plains, New York man who lost his life because he was the wrong color, at the wrong place, and at the wrong time.
"On November 19, 2011, my father, 68-year-old Kenneth Chamberlain Sr., was shot and killed in his home in White Plains, New York.


text:
Would you like to reduce your overall printing costs?
Are you ready for a fixed cost per page, pay-as-you-go printing option?
Is an all-inclusive solution for maintenance, service and all consumables what you are looking for?
Are you ready to simplify print management for your organization?
Our Print Management Solutions in include:
- Your choice of a variety of black and white and color network printers and copiers
- A single agreement that covers pages printed, maintenance, services and all consumables
- A solution that eliminates capital expenditures for equipment
- The ability to claim your printing costs as operating expenses for tax purposes
- A simple, flexible way tailored to meet your specific printing needs
Our Print Management Solutions include everything: service, maintenance, supplies – even the printer in one convenient cost per page price.
Let us help you identify the right devices for your business and provide all of your supplies and service while increasing your productivity and meeting your budgetary requirements.
Take the pain out of printing – allow us to provide you a custom print management solution in tailored to your specific business needs.

subset: commoncrawl


text:
It has become commonplace in India to point fingers at the central government when prices of essential commodities such as onion or fuel rise. The underlying arguments behind this accusation could be that: (1) the government is expected to maintain price stability and/or (2) the government should socially engineer agricultural markets in a 'fair' manner. But, is the pursuit of price stability not the job of the Reserve Bank of India (RBI)' It is true that the RBI cannot do anything to combat inflation when it is caused by a supply-and-demand mismatch in the domestic vegetable market or the international oil market. What the RBI can do is manage inflation expectations, and that is for another post. The present post is motivated by the insightful analyses of Kannan Kasturi on the Indian vegetable market, published in the Economic & Political Weekly and other places. That is, this post takes up the second of the reasons mentioned earlier.
The price mechanism ' adjustments made by producers to the selling prices and consumers to the purchasing prices ' is expected to allocate the commodities brought to the market amongst the consumers, in accordance with their needs, reflected in their willingness to pay. The prices therefore act as signals for the producers especially. Sellers can adjust quantity in order to affect prices; hoarding commodities is one such strategy. At equilibrium, producers earn a normal rate of profit, which contains a pure rate of return on capital advanced and a return for risk and entrepreneurship. If producers do not make normal profits in time t, they will cut down production in time t+1. During the equilibration process, producers who are unable to earn a normal rate of profit will exit the market. If entry costs are low, new producers will enter the market. Producers who have large financial resources (or access to easy credit) at their disposal are insulated from temporary alterations in demand. Producers who have enough accumulated earnings can shield themselves from such market volatility. In short, a competitive market is one where prices are not distorted (by the producers or by external intervention), no (especially, cultural and social) barriers to enter the market exist and workers are mobile within and across markets.
Of course, the agricultural markets in India are far from competitive. Since more than 50% of Indians derive their income from agriculture, and particularly because of the poverty of the farmers, these markets require government intervention. This is not to say that any form of government intervention will better the situation. Kasturi quite convincingly shows that the fault lies with the supply-side ' the agricultural supply chain. This post will not discuss minimum support prices or other input subsidies, such as for electricity, irrigation and fertilizers. Also to be noted is the specific manner in which the agricultural input markets are inter-linked in India, which has been of an exploitative nature. Finally, social and cultural factors (pertaining to caste and gender) are seen to hinder competitiveness in Indian markets, not just in agriculture.
What are the problems with the agricultural supply chain' Kasturi points out the following: (1) Small farmers lack storage facilities in order to gain from the high market prices. (2) The middlemen (those who intermediate between farmers and final consumers), i.e. the wholesale traders and commission agents have the ability to hoard vegetables and consequently they reap the benefits of the high prices they themselves engineer; the Agricultural Produce Marketing Act governs the agricultural markets (mandis) and it is here where all the proceeds from higher prices are absorbed with nothing reaching the farmers. These traders and commission agents are 'well entrenched in the mandis, having been in the business on average for 20 years' (3) Agricultural pricing is not at all transparent and the mandi records are of no assistance in this regard.
To sum up, the nature of government intervention has to change, in such a way that is beneficial to farmers. Proper laws are of utmost importance, not just in protecting the interests of the small farmers, but also that of the consumers. 'Moreover, intermediaries in any market perform useful functions but laws should be in place which ensures that they do not become monopolistic and exploitative. Agricultural infrastructure such as storage facilities is paramount in this context. A very detailed study of how these supply-chains operate will be of much help in our attempts to combat inflation.


text:
If you want to see it in action, see this RPC demo!
Some of the goals for the project are that it should
- be easy to use!!!
- be self contained,
no dependencies(now requires Flash) (not counting JSON) - be light weight
- be flexible
- have good code quality (uses jslint etc)
- have good documentation
- be the best xdm-library in existence
How easyXDM works
At the core easyXDM provides a transport stack capable of passing string based messages between two windows, a consumer (the main document) and a provider (a document included using an iframe). It does this by using one of several available techniques, always selecting the most efficient one for the current browser.
For all implementations the transport stack offers bi-directionality, reliability, queueing and sender-verification.
- IE6 and IE7 – using the
NixTransportFlashTransport (Microsoft Security Bulletin MS11-018) - IE8+ – using the PostMessageTransport
- Opera 9+ – using the PostMessageTransport (support for both Operas old standard and the HTML5 standard)
- Firefox 1-2 – using the FrameElementTransport
- Firefox 3+ – using the PostMessageTransport
- Safari 4+ – using the PostMessageTransport
- Chrome 2+ – using the PostMessageTransport
In browsers not mentioned here, and not supporting the postMessage API, the HashTransport will be used as a fallback.


text:
Compounds that occur naturally in cranberries may be good for the heart, researchers at the University of Wisconsin-Madison have found.
Early results from studies indicate that feeding cranberry juice powder seems to relax and open blood vessels in pigs that are genetically susceptible to developing atherosclerosis, or clogged arteries. Kris Kruse-Elliott, a veterinary anesthesiologist at the UW-Madison School of Veterinary Medicine, presented her results at the American Physiological Society's annual meeting in San Diego in April.
She and co-researcher Jess Reed, a nutritionist in the Department of Animal Sciences, set out to evaluate various whole foods that contain antioxidants, flavonoids and polyphenols, all compounds that may protect against heart disease. Cranberries contain all three, so they fed cranberry juice powder to pigs that were genetically predisposed to develop high cholesterol and atherosclerosis, just as some humans are.
"When these pigs were fed cranberry juice powder made from whole cranberries for six months, their vessels acted more like normal pigs," Kruse-Elliott says, meaning that the pigs' blood vessels relaxed and opened more.
Abnormal blood vessel function is an important component of heart disease. Finding ways to improve vessel function in patients with high cholesterol and atherosclerosis is critical to helping protect these patients from consequences such as heart attack or stroke.
"The next step is to determine what specific components of cranberries are most important to the improvements in vascular function that we observed, exactly how they modify blood vessel relaxation, and how they can be most easily consumed as part of the diet," Kruse-Elliott says. That last factor may be key. While pigs may not mind the intense tartness of concentrated cranberries, someone will need to make cranberry juice powder palatable to people before the next "heart-protection" diet is born.


text:
In order to comply with Article 10 of Law 34/2002 on Information Society Services and Electronic Commerce, we provide our data to users:
Corporate name: PROMOCIÓN Y DESARROLLO TURÍSTICO DE MENORCA S.L
Registered address: CALLE ÁNGEL, 10, 07703 MAHON, (Baleares)
Tax identification number (NIF): B07025315
Phone number: 971357481
Email: email@example.com
Website: www.splashsurmenorca.com
Registry data:
PROMOCIÓN Y DESARROLLO TURÍSTICO DE MENORCA S.L (hereafter, also the provider) as the owner of the website, makes this document available to users, which regulates the use of the website www.grupogaldana.com, with which we intend to comply with our obligations under Law 34/2002 on Information Society Services and Electronic Commerce (LSSICE or LSSI) as well as inform all users of the website as to the website's terms of use.
Through the website, PROMOCIÓN Y DESARROLLO TURÍSTICO DE MENORCA S.L makes it easier for users to access and use different services and content made available on the website.
Every person that accesses this website assumes the role of user (hereinafter, the user), which implies the full and unreserved acceptance of each of the provisions included in this Legal Notice as well as any other legal provisions that apply.
As users, you should carefully read this Legal Notice on any occasion that you visit the website since it may be subject to modifications. The provider reserves the right to modify any type of information that may appear on the website without the obligation to give prior notice or inform users of said obligations, with publication on the website of the provider being sufficient.
2.1. Free access and use of the website
The services provided by PROMOCIÓN Y DESARROLLO TURÍSTICO DE MENORCA S.L are free of charge for all users. However, some of the services provided through the website are subject to the payment of a specific price determined by the general terms and conditions of business.
2.2. User registration
In general, the provision of services does not require prior subscription or registration by users. Even so, PROMOCIÓN Y DESARROLLO TURÍSTICO DE MENORCA S.L restricts the use of some of the services to users who have previously completed the corresponding user registration. This registration must be carried out in the manner expressly indicated in the service section.
2.3. The veracity of the information
All information provided by the user must be true. For these purposes, the user guarantees the authenticity of the data communicated through the forms used for the subscription of services. It will be the user's responsibility to maintain all information provided to PROMOCIÓN Y DESARROLLO TURÍSTICO DE MENORCA S.L permanently updated so that it corresponds, at all times, to their current situation. In any event, the user will be solely responsible for any false or inaccurate statements made and for any damage that this causes to the provider or third parties.
2.4. Minors
For the use of the services, minors must always obtain prior consent from their parents, guardians, or legal representatives, who are ultimately responsible for all acts performed by the minors under their care. It is their responsibility to determine the specific content to which minors have access, which is why if they access content that is not appropriate on the internet, mechanisms should be established on their computers, such as programs, filters, and blockers, which allow them to limit the content available and, even though they are not infallible, which are especially useful for controlling and restricting the materials that minors can access.
2.5. Obligation to use the website correctly
The user commits to using the website in accordance with the law and this Legal Notice as well as with morals and good manners. In effect, the user shall refrain from using the site for unlawful or prohibited purposes that are harmful to the rights and interests of third parties or that in any way can damage, disable, overload, disrupt, or prevent the normal use of the computer equipment and the documents, files, and all types of content stored on any of the provider's computer equipment.
In particular, and by way of illustration but not exhaustive, the user undertakes to not transmit, disseminate, or make available to third parties the information, data, content, messages, graphics, drawings, sound or image files, photographs, recordings, software, and, in general, any kind of material that:
(a) is contrary to, disparages, or violates the fundamental rights and public freedoms recognised constitutionally, in international treaties, and in other existing regulations;
(b) induces, incites or promotes actions that are criminal, denigrating, defamatory, violent or, in general, contrary to law, morality, and public order;
(c) induces, incites, or promotes discriminatory actions, attitudes, or thoughts based on sex, race, religion, belief, age, or condition;
(d) is contrary to the right to honour, personal and family privacy, or people's self-image;
(e) damages the credibility of the provider or third parties in any way; or
(f) constitutes illegal, misleading, or unfair advertising.
The provider is exempt from any liability arising from the information published on our website, provided that this information has been manipulated or entered by a third party.
This website has been reviewed and tested to ensure that it functions properly. In principle, correct operation can be guaranteed 365 days a year, 24 hours a day. Nevertheless, the provider does not rule out the possibility of certain programming errors or that force majeure, natural disasters, strikes, or similar circumstances might occur and make access to the website impossible.
PROMOCIÓN Y DESARROLLO TURÍSTICO DE MENORCA S.Lmakes no warranty nor is it responsible, in any event, for the damages of any kind that may arise from the unavailability, maintenance, and effective operation of the website or its services and content; of the existence of viruses, malicious or harmful programs in the content; for the unlawful, negligent, fraudulent, or contrary to this Legal Notice and the Terms of Use; or of the lack of legality, quality, reliability, usefulness, and availability of the services provided by third parties and made available to users on the website.
Under no circumstances is the provider liable for any damages that may arise from the illegal or improper use of this website.
The provider's website may use cookies (small data files that the server sends to the computer of the person accessing the page) to perform certain functions that are considered essential for the proper functioning and visualisation of the website. In any case, the cookies used are temporary in nature with the sole purpose of making browsing more efficient and disappearing at the end of the user's session. Under no circumstances will the cookies be used to collect personal information. For more information, see our Cookie Policy.
On the website, you may be redirected to sponsored content, advertisements, and/or links from affiliates and/or third-party websites.
In the links provided, there is the possibility to learn about or refer to products and/or services from third parties. Given that we cannot control the content introduced by third parties, PROMOCIÓN Y DESARROLLO TURÍSTICO DE MENORCA S.L does not assume any responsibility for said content, nor does it guarantee the experience, integrity, or quality of those products. In any case, the provider declares that it will proceed to immediately remove any content that could contravene national or international legislation, morality, or public order, proceeding to the immediate removal of the redirection to those websites, informing the competent authorities about the content in question.
PROMOCIÓN Y DESARROLLO TURÍSTICO DE MENORCA S.L will have these links published until they are removed or deleted by the provider or the advertiser and will not be liable even if these ads can be indexed by search engines outside this website.
The provider is not responsible for the information and content stored, including but not limited to forums, chats, blog generators, comments, social networks, and any other means that allow third parties to publish content independently on the provider's website. Nevertheless, in compliance with the provisions of Articles 11 and 16 of the LSSICE, the provider makes itself available to all users, authorities, and security forces, and actively collaborates in the withdrawal or, where necessary, the blocking of all content that may affect or contravene national or international law, third party rights, morality, or public order. In the event that the user considers that there may be some content that could be susceptible to this classification, please notify the website administrator immediately.
However, PROMOCIÓN Y DESARROLLO TURÍSTICO DE MENORCA S.L informs you that any contractual or non-contractual relationship that the user formalises with these third parties, affiliates, or advertisers through the links provided by this website will be valid only and exclusively between the user and the advertiser and/or third party and that PROMOCIÓN Y DESARROLLO TURÍSTICO DE MENORCA S.L will not be liable for any damage that could be caused by the provision of services and/or contractual or non-contractual relationships made between the user and the advertisers or third parties contacted through this portal since the provider only acts as an intermediary or advertising medium.
The provider is deeply committed to complying with the personal data protection regulations and guarantees full compliance with the obligations set forth as well as the implementation of the security measures outlined in the European General Data Protection Regulation and the Spanish data protection regulations. For more information, see our Privacy Policy.
The website, including but not limited to the programming, editing, compilation, and other elements necessary for its operation, the designs, logos, text, photographs, and/or graphics, is the property of the provider or, if necessary, has been expressly licensed or authorised by the authors. All of the content on the website is duly protected by intellectual and industrial property regulations.
Regardless of the purpose for which it is intended, the total or partial reproduction, use, distribution, and public communication require prior written authorisation by the provider. Any use not previously authorised by the provider will be considered a serious breach of the intellectual or industrial property rights of the author.
The designs, logos, text, and/or graphics that are unconnected to the provider and that may appear on the website belong to their respective owners, who are themselves responsible for any possible controversy that may arise with respect to them. In any case, the provider has their express prior authorisation.
The provider recognises, on behalf of its owners, the corresponding industrial and intellectual property rights, not implying the mention or appearance on the website, the existence of rights or responsibility of the providers for the same, nor the endorsement, sponsorship, or recommendation by the same.
To make any kind of observation regarding possible breaches of intellectual or industrial property rights as well as on any of the content on the website, you can do so through the email listed above.
For the resolution of disputes or issues related to this website or the activities carried out therein, Spanish legislation will be applied. All parties will expressly submit themselves to the Courts and Tribunals of Baleares for the resolution of all disputes arising out of or relating to its use.


text:
Little Red Winter Framed
Cedar Mountain is our love story. It goes like this. Boy meets girl. Girl meets boy. Boy (Don) is a theatre designer from Winnipeg with a burning desire to make and sell wooden birds. Girl (Suzanne) is a teacher in training from Vancouver with no ideas whatsoever about wooden birds. Boy and girl go on a date, share a bottle of wine and their hearts crack open.
They came to Saltspring Island in British Columbia, Canada for a getaway in January 1993 and decided to move. Almost forty years have since past, and they've made thousands of products in our backyard workshop. It's very personal. It's frenetic. Every single thing that leaves our studio is authentically us. It's absolutely overflowing with passion and made with love.


text:
About TED
TED is a nonprofit devoted to spreading ideas, usually in the form of short, powerful talks (18 minutes or less). TED began in 1984 as a conference where Technology, Entertainment and Design converged, and today covers almost all topics — from science to business to global issues — in more than 100 languages. Meanwhile, independently run TEDx events help share ideas in communities around the world.


text:
270: Authentication in Rails 3.1
(view original Railscast)
Rails 3.1 come with new features related to authentication and in this episode we'll show you how some of them work. To demonstrate them we have a simple application with a page that can be accessed by anyone who knows the URL.
HTTP Basic Authentication
We want to add authorization to this page so that it can only be accessed by certain users. For this we need to add some authentication and the quickest way to add this is to add HTTP Basic authentication. Rails 3.1 gives us a new way to do this; all we need to do is to modify the page's controller and add a call to a new method called http_basic_authenticate_with
which takes :name
and :password
class SecretController < ApplicationController http_basic_authenticate_with :name => "frodo", :password => "thering" def index end end
If we want to restrict the authentication to certain actions we can add an :only
or :except
option. Obviously in a real application we'd move the username and password into a config file rather than having it in plain view in the code but for this demo application it can be left as it is.
When we visit the page now we'll see a login dialogue and we'll only be able to view the page by entering the correct username and password we specified in http_basic_authenticate_with
HTTP Basic is a little under-utilized. It's quick and easy to add whenever we need to make part of a site private and in Rails 3.1 it's even easier to implement.
Using secure_password
Sometimes though we need a more comprehensive authorization system that can handle multiple users and to help with that Rails 3.1 gives us secure_password
Back in episode 250 [watch, read] we created an authentication system from scratch and Rails 3.1 makes doing this quite a bit easier. We'll do this now and replace the HTTP Basic authentication with our own.
The first thing to do is to generate a User
model with fields for an email address and a password.
$ rails g model user email:string password_digest:string
We can then create the database table by migrating the database.
$ rake db:migrate
The important thing here is that we call the field that will store passwords password_digest
. Next we'll need to add a call to has_secure_password
in the User
class User < ActiveRecord::Base has_secure_password end
This adds methods to set and authenticate the entered password, adds validators for the password and password confirmation and also adds authentication functionality. The password_digest
field we created earlier is used in the background to store the hashed password.
By default there's no validates_presence_of
validator for the password so we'll add one that fires when a new user is created.
class User < ActiveRecord::Base has_secure_password validates_presence_of :password, :on => :create end
Normally we'd want to validate the email address too but we won't to that here.
To allow users to create accounts we'll create a UsersController
$ rails g controller users
The code for the controller is fairly standard and looks like this:
class UsersController < ApplicationController def new @user = User.new end def create @user = User.new(params[:user]) if @user.save redirect_to root_url, :notice => "Signed up!" else render "new" end end end
The new view contains a form for signing up.

Sign Up
 <%= form_for @user do |f| %> <% if @user.errors.any? %>

Form is invalid

 <% for message in @user.errors.full_messages %>
<%= message %>
 <% end %>

 <% end %>
 <%= f.label :email %> <%= f.text_field :email %>

 <%= f.label :password %> <%= f.password_field :password %>

 <%= f.label :password_confirmation %> <%= f.password_field :password_confirmation %>

<%= f.submit %>
 <% end %>
If we try signing up and enter a password that doesn't match the confirmation we'll see the validation message that was provided by has_secure_password
When we enter a matching password confirmation we'll be signed up successfully.
Users can sign up but not yet sign in so next we'll create a login form with email and password fields.

Log in
 <%= form_tag sessions_path do %>
 <%= label_tag :email %> <%= text_field_tag :email, params[:email] %>

 <%= label_tag :password %> <%= password_field_tag :password %>

<%= submit_tag "Log in" %>
 <% end %>
Note that the form uses form_tag
rather than form_for
as we're not editing a resource here. The form is submitted to a sessions_path
and so we'll need a new SessionsController
$ rails g controller sessions
This controller will have new
, create
and destroy
actions so that users can log in and out.
class SessionsController < ApplicationController def new end def create if # authenticated? session[:user_id] = user.id redirect_to root_url, :notice => "Logged in!" else flash.now.alert = "Invalid email or password" render "new" end end def destroy session[:user_id] = nil redirect_to root_url, :notice => "Logged out!" end end
The create
action isn't quite completed yet as we're yet to write the code that determines whether the user who's logging in is authenticated or not. This is where we can take advantage of what Rails 3.1 gives us with secure_password
The first thing we'll need to do is to fetch the user whose email address matches the value entered in the form. We can then call authenticate
on that user, which is a method that has_secure_password
gives us, passing in the password that was entered in the form. This method will check the password against the password digest in the database. If no matching user is found then find_by_email
will return nil
so we check that the user exists before authenticating them.
def create user = User.find_by_email(params[:email]) if user && user.authenticate(params[:password]) session[:user_id] = user.id redirect_to root_url, :notice => "Logged in!" else flash.now.alert = "Invalid email or password" render "new" end end
This is all we need to do to authenticate through secure_password
. We can test this out by trying to log in. If we enter an incorrect password we won't be authenticated.
If we log in with the correct credentials we'll be authenticated and redirected to the home page.
Elsewhere in our application we need to get the currently logged-in user so we'll add a current_user
method in the ApplicationController
and make it a helper method so that we can access it in the views. This method will fetch the current user from the session.
class ApplicationController < ActionController::Base protect_from_forgery private def current_user @current_user ||= User.find(session[:user_id]) if session[:user_id] end helper_method :current_user end
What's really nice about this method of authentication is how simple the User
model is, just two lines of code.
class User < ActiveRecord::Base has_secure_password validates_presence_of :password, :on => :create end
By comparison the solution we created in episode 250 had a much more complex User
model. That said it would be wise to add an attr_accessible
line to the model so that only the email, password and password_confirmation
fields can be set through the user registration form.
class User < ActiveRecord::Base attr_accessible :email, :password, :password_confirmation has_secure_password validates_presence_of :password, :on => :create end
Adding HTTPS
If we're handling authentication in our applications we don't really want to send credentials over the wire in plain text so it's a good idea to use SSL and switch over to HTTPS. Prior to Rails 3.1 this had to be done either manually or through a plugin but now there's a much simpler way to implement it.
To restrict a controller so that it has to be accessed with HTTPS we simply need to add a call to the force_ssl
class method. If want to restrict this only certain actions within a controller we can use the :only
or :except
options like we would when using a before_filter
class ApplicationController < ActionController::Base protect_from_forgery force_ssl private def current_user @current_user ||= User.find(session[:user_id]) if session[:user_id] end helper_method :current_user end
The force_ssl
method only forces HTTPS in test or production modes. If we restart our application's server in production mode and reload the signup page it will try to redirect to the SSL version.
This fails as our server doesn't support HTTPS but if it did we'd see the secure version of this page.
That's it for this episode on authentication in Rails 3.1. All of the new authentication additions it provides make it much easier to add authentication to our Rails applications.