TokiTranslate/app/controllers/dictionary_controller.rb
2023-12-06 15:53:25 -05:00

18 lines
384 B
Ruby

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