Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
コントローラのグループ化について
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  9 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
kiyo  
View profile   Translate to Translated (View Original)
 More options Sep 15 2009, 9:15 pm
From: kiyo <kiyot...@f4.dion.ne.jp>
Date: Tue, 15 Sep 2009 18:15:02 -0700 (PDT)
Local: Tues, Sep 15 2009 9:15 pm
Subject: コントローラのグループ化について
Kiyoです。

Rails2.2.2で、コントローラを機能別にグループ化したのですが、
「uninitialized constant Tokyugen::JinjisController」のエラーが発生しました。

フォルダは、app、helpers、models、viewsの下に作成しました。

jinjis_controller.rbと、application.rbは以下のように修正しております。

【jinjis_controller.rb】
class Tokyugen::JinjisController < Tokyugen::ApplicationController

【application.rb】
class Tokyugen::ApplicationController < ActionController::Base

この対応では、まずいのでしょうか?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
片山嘉國  
View profile   Translate to Translated (View Original)
 More options Sep 15 2009, 9:43 pm
From: 片山嘉國 <yoshikunic...@gmail.com>
Date: Wed, 16 Sep 2009 10:43:14 +0900
Local: Tues, Sep 15 2009 9:43 pm
Subject: Re: [rbc-incubator:113] コントローラのグループ化について
片山よしくにと申します。

ご質問の件ですが、コントローラを機能別に分けたいときは私は以下のように
しています。

ruby script/generate controller group/test

このようにすると、

      create  app/controllers/group
      create  app/helpers/group
      create  app/views/group/test
      create  test/functional/group
      create  test/unit/helpers/group
      create  app/controllers/group/test_controller.rb
      create  test/functional/group/test_controller_test.rb
      create  app/helpers/group/test_helper.rb
      create  test/unit/helpers/group/test_helper_test.rb

こんな感じで、「group」というフォルダの下に該当のコントローラやビュー
などが作成されます。

アクセスするためのURLは

http://xxx.xxx.xx/group/test

のようなURLになります。

もしかすると、railsのソースツリーを

app/group/controllers/test.rb
app/group/views/test.htnl.erb

のような形にしたいのかもしれませんが、上記のようにする場合の方法は
私は存じません。

ご参考になればと思います。
よろしくお願いします。

2009年9月16日10:15 kiyo <kiyot...@f4.dion.ne.jp>:

--
==♪==♯==♪==♯==♪==♯==♪==♯==♪==♯==♪==
 片山 嘉國 (Yoshikuni Katayama)
 有限会社ライトハウス
 URL: http://www.l-house.net/
 E-Mail:katay...@l-house.net
 eNote-無料で使える日報管理&グループウェア
  まずは覗いてみて → http://www.enote.jp/
==♭==♪==♭==♪==♭==♪==♭==♪==♭==♪==♭==

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
kiyo  
View profile   Translate to Translated (View Original)
 More options Sep 15 2009, 11:00 pm
From: kiyo <kiyot...@f4.dion.ne.jp>
Date: Tue, 15 Sep 2009 20:00:07 -0700 (PDT)
Local: Tues, Sep 15 2009 11:00 pm
Subject: Re: コントローラのグループ化について
片山さん。

ご回答ありがとうございました。

まさに、やりたいのは「app/controllers/group」です。

ruby script/generate controller group/test を実行すると、
test_controller.rbがapp/controllers/group配下に作成されて、
application.rbはapp/controllersの配下のようですので、
application.rbに記述した
「class Tokyugen::ApplicationController < ActionController::Base」を
「class ApplicationController < ActionController::Base」に戻して、
配置先をapp/controllersにしました。

そんの結果、「No action responded to tokyuGen. Actions index」となりました。
原因が良くわかりません。
ご教示頂けませんでしょうか。

【フォルダ構成】
/Jinji/app/controllers/tokyugen

【Controllerのコーディング】
class Tokyugen::JinjisController < ApplicationController
  # GET /jinjis
  # GET /jinjis.xml
  def index
    @jinjis = Jinji.find(:all)

    respond_to do |format|
      format.html { render :action => tokyugen }# tokyugen.html.erb
      format.xml  { render :xml => @jinjis }
    end
  end


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
片山嘉國  
View profile   Translate to Translated (View Original)
 More options Sep 15 2009, 11:42 pm
From: 片山嘉國 <katay...@l-house.net>
Date: Wed, 16 Sep 2009 12:42:06 +0900
Local: Tues, Sep 15 2009 11:42 pm
Subject: Re: [rbc-incubator:116] Re: コントローラのグループ化について
片山よしくにです。

application.rbの記述は、最初にrailsのプロジェクトを作成したときに出来ている
記述に戻してもらえれば問題ないと思います。

ということですが、以下を確認していただけますか?

1.「No action responded to tokyuGen. Actions index」とありますが、
 tokyuGenではなくてtokyugenですよね?(ただのミスタイプ?)
 もし、このままのエラーメッセージが出たとしたら、ブラウザに入力した
 URLが間違えたのかも・・・?

2.viewのファイルを確認してください。
 app/views/tokyugen/jinjis/tokyugen.html.erb
 というファイルがindex.html.erbの代わりに表示されるはずなのですが・・。

頂いたメールの情報から察すると、この辺りが怪しいのではないかと思う
のですが、如何でしょうか?

それではよろしくお願いします。

2009年9月16日12:00 kiyo <kiyot...@f4.dion.ne.jp>:

--
==♪==♯==♪==♯==♪==♯==♪==♯==♪==♯==♪==
 片山 嘉國 (Yoshikuni Katayama)
 有限会社ライトハウス
 URL: http://www.l-house.net/
 E-Mail:katay...@l-house.net
 eNote-無料で使える日報管理&グループウェア
  まずは覗いてみて → http://www.enote.jp/
==♭==♪==♭==♪==♭==♪==♭==♪==♭==♪==♭==

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
kiyo  
View profile   Translate to Translated (View Original)
 More options Sep 16 2009, 12:08 am
From: kiyo <kiyot...@f4.dion.ne.jp>
Date: Tue, 15 Sep 2009 21:08:38 -0700 (PDT)
Local: Wed, Sep 16 2009 12:08 am
Subject: Re: コントローラのグループ化について
Kiyoです。

> 1.「No action responded to tokyuGen. Actions index」とありますが、
>  tokyuGenではなくてtokyugenですよね?(ただのミスタイプ?)
>  もし、このままのエラーメッセージが出たとしたら、ブラウザに入力した
>  URLが間違えたのかも・・・?

eclipseで確認しているのですが、
Urlは小文字で入力しているのですが、
エラーメッセージは大文字で表示されています。

Grepしてみたのですが、logにしかtokyuGenの文字列は存在しませんでした。
一度、tokyuGenでフォルダー等を作成していたので、tokyugenに変更しました。

> 2.viewのファイルを確認してください。
>  app/views/tokyugen/jinjis/tokyugen.html.erb
>  というファイルがindex.html.erbの代わりに表示されるはずなのですが・・。

app/views/tokyugen/jinjis/の配下に、tokyugen.html.erbは存在しております。
このViewを表示して欲しいのですが・・・・

それと、
「Rendering C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
action_controller/templates/rescues/layout.erb (not_found)」の
メッセージも出力されていたのが、ちょっと気になります。


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
kiyo  
View profile   Translate to Translated (View Original)
 More options Sep 16 2009, 2:10 am
From: kiyo <kiyot...@f4.dion.ne.jp>
Date: Tue, 15 Sep 2009 23:10:01 -0700 (PDT)
Local: Wed, Sep 16 2009 2:10 am
Subject: Re: コントローラのグループ化について
Kiyoです。
どうも不思議なのですが、
マシンの再起動を行なったらOKでした。

環境設定がまずいのかな・・・・


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
片山嘉國  
View profile   Translate to Translated (View Original)
 More options Sep 16 2009, 6:57 am
From: 片山嘉國 <katay...@l-house.net>
Date: Wed, 16 Sep 2009 19:57:30 +0900
Local: Wed, Sep 16 2009 6:57 am
Subject: Re: [rbc-incubator:122] Re: コントローラのグループ化について
片山よしくにです。

問題が解決されたようで、何よりです。

自分も細かい条件は把握していないのですが、development環境で開発していても、
railsを動かしているサーバー(Webrickやmongrelなど)を再起動しないと反映しない
ケースがあります。

コントローラやモデルを追加した場合や、config配下のファイルを変更した場合、
プラグインなどを追加した場合などはサーバーを再起動しないと反映されません。

それとも、動かしているマシン(PC?)自体を再起動したらOKだったということ
ですか?もしそうだったなら不思議ですね・・・。

2009年9月16日15:10 kiyo <kiyot...@f4.dion.ne.jp>:

> Kiyoです。
> どうも不思議なのですが、
> マシンの再起動を行なったらOKでした。

> 環境設定がまずいのかな・・・・

--
==♪==♯==♪==♯==♪==♯==♪==♯==♪==♯==♪==
 片山 嘉國 (Yoshikuni Katayama)
 有限会社ライトハウス
 URL: http://www.l-house.net/
 E-Mail:katay...@l-house.net
 eNote-無料で使える日報管理&グループウェア
  まずは覗いてみて → http://www.enote.jp/
==♭==♪==♭==♪==♭==♪==♭==♪==♭==♪==♭==

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Yozo SATO  
View profile   Translate to Translated (View Original)
 More options Sep 18 2009, 1:02 am
From: Yozo SATO <yoozoos...@gmail.com>
Date: Fri, 18 Sep 2009 14:02:33 +0900
Local: Fri, Sep 18 2009 1:02 am
Subject: Re: [rbc-incubator:123] Re: コントローラのグループ化について
さとうようぞう といいます。こんにちは。
まさかそんなことはあるまい、とは思いますが、可能性がゼロではないので一応・・・

「エディットしたファイルを保存してなかった」とか。

サーバーを再起動するときは、保存されていないファイルがあります、とかの
ダイアログが出ないと思いますが、OSそのものを落とす時にはエディタが終了時に
保存されていないファイルがあります、と警告を出してくれるはずなので。。。

2009年9月16日19:57 片山嘉國 <katay...@l-house.net>:

--
yoozoos...@gmail.com

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
kiyo  
View profile   Translate to Translated (View Original)
 More options Sep 19 2009, 5:01 pm
From: "kiyo" <kiyot...@f4.dion.ne.jp>
Date: Sun, 20 Sep 2009 06:01:22 +0900
Local: Sat, Sep 19 2009 5:01 pm
Subject: Re: [rbc-incubator:124] Re: コントローラのグループ化について

Kiyoです。

さとうようぞう さん、返信有難うございました。

さすがに、それはないです。 (笑)

なんとか、初期画面表示までできました。

ご回答くださった皆さん、有難うございます。

# 次は、画面への入力チェック、DBアクセス、次画面遷移の実装。また一波乱ありそう・・・・

--------------------------------------------------------------------------- -----

No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.409 / Virus Database: 270.13.104/2379 - Release Date: 09/17/09
15:55:00

No virus found in this outgoing message.
Checked by AVG - www.avg.com
Version: 8.5.409 / Virus Database: 270.13.107/2382 - Release Date: 09/19/09 06:03:00


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions Older topic »