In my rails app I have a movies table, a movie has a release\_date (date/month/year).

I also have a years table which will display all movies from a specific year
If i create the year 2013, I would like to display all movies from the year 2013

In my years controller, in the :show action, I have this 

```
@movies = Movie.where(:release_date => :ynumber)

```

But it doesn't show any movies from that year, even though there are movies with a release\_date 2013.

I assume that it isnt showing because when I call :release\_date, it is displaying (date/month/year). How can I have it display ONLY `year`?

I've tried using `.strftime("%Y")` and `.strptime("%Y")` but these dont seem to work

PS: I am using SQLite3 in development mode and PostgreSQL in production mode

Years#show 

```
def show

    @year = Year.find(params[:id])

    #those i've tried seperately which havent worked
    @movies = Movie.where("extract(year from release_date) = ?", ynumber)
    @movies = Movie.where("extract(year from release_date) = ?", :ynumber)
    @movies = Movie.where("extract(year from release_date) = ?", 'ynumber')
    @movies = Movie.where("extract(year from release_date) = ?", ':ynumber')
    @movies = Movie.where("extract(year from release_date) = ?", params[:ynumber])

    respond_to do |format|
      format.html # show.html.erb
      format.json { render json: @year }
    end
  end

```