[Ruby] After posting an article on Rails Simple Calendar, I want to reflect it on the calendar.

less than 1 minute read

At Simple Calendar I want to do article posting → calendar posting screen (create) → reflect on calendar, Currently, I can post articles, and I want to extract the title data of article posts from there and display only the title data on the calendar posting screen. 540d264cf48615032c7353a06dffbdf6.png *Title is the input form on this screen, but I want to get this Title from this Title.

I tried 5336e6a17d83d2db786feb63021d995c.png


  • @tweets.each do |tweet| = @tweet.title I entered d2cf2caa748b7b3ad991e29b02e302bb.png

I got an error like this:

As an association of blog (calendar) and tweet (article) 4c606c184b85049ae3185dc556a08022.png 025a6b6e9003a3707599aa75945c6d5e.png

Is organized like this.

The blog db (database) is here.

create_table :blogs do |t|
  t.string :title
  t.text :content
  t.datetime :start_time
  t.references :user, foreign_key: true
  t.references :tweet, foreign_key: true
  t.string :tweet_title

blog_controller is here.


When I posted an article, I could display the view on other pages. 52b32613dc3a1aa18170323ae8d61abe.png db9032b4f568d364a6a228d3c5415f0b.png

I would appreciate if you could answer. I am an immature person, but I would appreciate your favor.