Coder Social home page Coder Social logo

webdev2013model's Introduction

WebDev 2013

Tema ar trebui sa va ia aproximativ 1-2 ore cu tot cu extra study.

In aplicatie aveti 3 modele, ca la curs: Song, Author si Playlist

Task-uri:

  • Daca nu aveti deja proiectul de la curs, fork-uiti repository-ul acesta pe repo-ul vostru dupa care clonati-l la voi pe laptop

  1. Intrati in consola ($rails console) si creati 3 cantece, 3 autori si 3 playlist-uri dupa forma:

 song = Song.new(:title => "Song1", :duration => 120)

 song.build_author(:name => "Author1", :year => DateTime.new(1980))

 song.build_playlist(:name => "Playlist1", :player_name => "Winamp")

 song.save

song = Song.new(:title => "Song2", :duration => 150)

song.build_author(:name => "Author2", :year => DateTime.new(1990))

song.build_playlist(:name => "Playlist2", :player_name => "Winamp")

song.save

song = Song.new(:title => "Song3", :duration => 220)

song.build_author(:name => "Author3", :year => DateTime.new(2000))

song.build_playlist(:name => "Playlist3", :player_name => "FooBar")

song.save

2 Creati o actiune noua numita “filter” in controller-ul songs si afisati sub ce forma preferati:

2.1. Cantecele care dureaza mai mult de 140 de secunde

2.2. Cantecele dintre anii 1970 si 1995

2.3. Playlist-urile pentru winamp

2.4. Cantecele care sunt cantate in Winamp

2.5. Cantecele ai caror autori au anul mai mare de 1985

2.6. Autorii care au in nume “Author”

  1. Adaugati coloana listen_count de tip integer la tabela Song si de fiecare data cand se intra in pagina unui Song, incrementati contorul

Referinte:

  1. guides.rubyonrails.org/

  2. stackoverflow.com/questions/9192130/like-clause-with-rails-3-and-sqlite

  3. Prezentarea de la curs pe care o gasiti in folder-ul “docs”

Daca aveti rails 4 si intrati in consola si aveti problema aceasta:

1.9.3-p448 :001 > Playlist

Playlist(no database connection)

Dati comanda: Playlist.connection

Ca sa aduceti in consola modificarile pe care le-ati facut in proiect, rulati: reload! in consola de Rails

webdev2013model's People

Contributors

gvoicu avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.