This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# db/migrates/*_add_locale_to_users.rb | |
class AddLocaleToUsers < ActiveRecord::Migration | |
def change | |
add_column :users, :locale, :string, default: "fr" | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# app/views/users/index.html.erb | |
<h1>Liste des utilisateurs</h1> | |
<ul> | |
<% @users.each do |user| %> | |
<li><%= user.id %></li> | |
<% end %> | |
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# app/views/users/home.html.erb | |
<% if @current_user %> | |
<h1>Bienvenue <%= @current_user.name %> !</h1> | |
<%= form_tag "/users/login", method: :delete do %> | |
<input type="submit" value="Déconnexion" /> | |
<% end %> | |
<% else %> | |
<h1>Bienvenue visiteur anonyme !</h1> | |
<a href="/users/login">S'identifier</a> | |
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Configurer git et vim | |
git config --global core.editor "vim" | |
vim ~/.vimrc | |
syn on | |
set tabstop=2 | |
set shiftwidth=2 | |
set expandtab | |
match Todo /\s\+$/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script> | |
= simple_form_for(@account) do |f| | |
= f.error_notification | |
= f.input :type, collection:['iban', 'rib'], include_blank: false | |
#iban | |
.inputs | |
= f.input :iban, :include_blank => false | |
= f.input :bic, :include_blank => false |
NewerOlder