class DictionaryController < ApplicationController def index @english = Language.where(name: "English") @parts_of_speech = PartOfSpeech.where(language_id: @english) @parts_of_speech.each do |pos| pos.translations.build end @words = Word.all end def show @letter = params[:id] @words = Word.where('substr(word, 1, 1) = ?', @letter) end end