TokiTranslate/app/controllers/dictionary_controller.rb

18 lines
384 B
Ruby
Raw Permalink Normal View History

class DictionaryController < ApplicationController
def index
2023-12-06 20:53:25 +00:00
@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