Sha256: bc90aeee7aae733f811ef45ad2a2aa52be039ee99f4bdf67550bebb5daf805f5

Contents?: true

Size: 1.24 KB

Versions: 3

Compression:

Stored size: 1.24 KB

Contents

# EncryptedFormFields [![Build Status](https://travis-ci.org/lautis/encrypted_form_fields.png)](https://travis-ci.org/lautis/encrypted_form_fields)

Encrypted form fields for Rails apps.

## Installation

Add this line to your application's Gemfile:

    gem 'encrypted_form_fields'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install encrypted_form_fields

## Usage

Configure necessary encryption keys in Rails initializer:

```ruby
EncryptedFormFields.secret_key_base = # your secret key base
EncryptedFormFields.secret_token = # your secret token

```

Create encrypted inputs in your view:

```erb

<%= form_for(user) do |f| %>
  <%= f.encrypted_field :secrets %>
  <%= encrypted_field_tag :field_name, "secret data" %>
<% end %>

```

Then access the data in controller:

```ruby

class SomeController
  def create
    # do stuff...
    encrypted_params # This will contain values of encrypted parameters
    # do stuff...
  end
end
```

## Contributing

1. Fork it ( http://github.com/lautis/encrypted_form_fields/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
encrypted_form_fields-0.2.1 README.md
encrypted_form_fields-0.2.0 README.md
encrypted_form_fields-0.1.0 README.md