blog.federicomaffei.com

current level - articles for beginners

Day 40.

rails new --help
rails new first_application -T -d postgresql
cd first_application
subl .
bundle
bin/rails generate rspec:install

Read more...

Day 38.

<h1>Cool Instagram App</h1>
<form id='search' method="post">
    <input type='text' id='tag' placeholder='Enter a tag'>
    <button type='submit' id='button'>Search for a tag:</button>
</form>
<div id="target"></div>

Read more...

Day 37.

$(document).ready(function(){
    $('#add_profile').on('submit', function(event){
        event.preventDefault();
        var username = $('#username').val();
        $.get('https://api.github.com/users/' + username, function(user){
        var newProfile = Mustache.render($('#profile-template').html(), user);
        $('.profile-container').append(newProfile);
        });
    });
});

Read more...

Day 36.

function Football(player1, player2) {
    var player1 = 'Italia';
    var player2 = 'Uruguay';
};

Football.prototype.loser = function() {
return 'Italia'
};

Read more...

Day 33.

cohort = Cohort.first(:month => 'may')
cohort.update(:status => 'SENIORS')

Read more...