[Rails] Redirect and Flash 문법
기본적인 문법 class PostsController < ApplicationControllerdef edit@post = Post.find(params[:id])if session[:user_id] != @post.user_idflash[:notice] = "Sorry, you can't edit this post"redirect_to post_pathendendend 대체가능한 문법class PostsController < ApplicationControllerdef edit@post = Post.find(params[:id])if session[:user_id] != @post.user_idredirect_to (post_path, notice: "Sorry, you can't edit this p..
Ruby&Rails/Rails
2015. 6. 24. 21:04
반응형
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- AI반도체
- 주식투자
- 엔비디아
- 방산주
- 한화오션
- ruby
- 현대차
- SK하이닉스
- HBM
- 호르무즈해협
- rabbitmq
- 반도체관련주
- 개인투자자
- ruby on rails
- 삼성전자
- 한화에어로스페이스
- CSS
- OpenStack
- Message Queue
- Rails
- Java
- 알고리즘
- 자료구조
- 국제유가
- 한미반도체
- javascript
- 투자전략
- 이펙티브 자바
- html
- 프로그래밍
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | |||
| 5 | 6 | 7 | 8 | 9 | 10 | 11 |
| 12 | 13 | 14 | 15 | 16 | 17 | 18 |
| 19 | 20 | 21 | 22 | 23 | 24 | 25 |
| 26 | 27 | 28 | 29 | 30 | 31 |
글 보관함
