{"author_name":"ayato0211","version":"1.0","image_url":null,"categories":["Rails"],"url":"https://ayato.hateblo.jp/entry/20140110/1389280392","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fayato.hateblo.jp%2Fentry%2F20140110%2F1389280392\" title=\"Rails \u306e redirect_to \u3067\u30cf\u30de\u3063\u305f - (define -ayalog &#39;())\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","title":"Rails \u306e redirect_to \u3067\u30cf\u30de\u3063\u305f","width":"100%","provider_url":"https://hatena.blog","published":"2014-01-10 00:13:12","type":"rich","blog_title":"(define -ayalog '())","blog_url":"https://ayato.hateblo.jp/","provider_name":"Hatena Blog","height":"190","description":"\u30cf\u30de\u3063\u305f\u306e\u306f\u3053\u3093\u306a\u30b3\u30fc\u30c9\u3092\u66f8\u3044\u3066\u3044\u305f\u304b\u3089. def authorize user = User.find_by_id(login_user_id) unless user redirect_to root_path end if not user.registered redirect_to register_users_path end end \u3088\u304f\u3042\u308b\u30e6\u30fc\u30b6\u30fc\u8a8d\u8a3c\u30e1\u30bd\u30c3\u30c9\u3060\u3068\u601d\u3046. \u671f\u5f85\u3057\u305f\u52d5\u4f5c\u306f\u3053\u3046. \u307e\u305a, user \u304c\u5b58\u5728\u3057\u306a\u3044\u5834\u5408 nil \u306a\u306e\u3067 root_path \u3078\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3059\u308b. user \u304c\u5b58\u5728\u3057\u3066\u3044\u308b\u304c, \u60c5\u5831\u304c\u767b\u9332\u3055\u308c\u3066\u3044\u306a\u3044\u5834\u5408, register_user_pat\u2026","author_url":"https://blog.hatena.ne.jp/ayato0211/"}