I'm just returning the Datamaprint records in a random order . Here is my model (sqlite3 database using datamapar): and Here's how I am recording ( Inatra) Returning I believe you can do it (based) Are: In addition, the same post - or -
Datamapper in class movie :: resource datamapare :: property :: string.lombie (255) property : ID, serial property: title, string property: img, string property: description, string property: year, string property: made_at, datetime, en: voting related_to: user end
get '/' do @movies = movie. All # & lt; - What should it look like? Haml: home end
@movies = Movie.all.sort_by {rand}
Array # shuffle! and possibly drag something like this:
@movies = Movie.all.shuffle #no! Since you are not changing the position; Not sure that DM supports it
@movies = movie.Sure @ movies.Space!
Comments
Post a Comment