Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #config/routes.rb
- Rails.application.routes.draw do
- resources :tweets do
- resources :likes
- end
- resources :users
- root 'tweets#index'
- end
- #views/tweets/show.html.erb
- <p id="notice"><%= notice %></p>
- <p>
- <strong>Text:</strong>
- <%= @tweet.text %>
- </p>
- <p>
- <strong>User:</strong>
- <%= @tweet.user.name %>
- </p>
- <p>
- <%= link_to 'Like', @tweet.like %>
- </p>
- <%= link_to 'Edit', edit_tweet_path(@tweet) %> |
- <%= link_to 'Back', tweets_path %>
Advertisement
Add Comment
Please, Sign In to add comment