2017-03-23 6 views
0

Ember POD構文を使用してEmberアプリケーションを整理しています。Emberフレームワークで、URLからポッドフォルダ名を削除するには

picture of files organized under POD directory named 'main'

それは、ブラウザのURLに表示されポッドディレクトリを削除することは可能ですか?もしそうなら、どうですか?

画像を参照してください。

picture of the pod directory in the URL path

これが私の現在のrouter.jsが

Router.map(function() { 
    this.route('main', function() { 
    this.route('about'); 
    this.route('focus', function() { 
     this.route('show'); 
    }); 
    this.route('projects', function() { 
     this.route('show'); 
    }); 
    this.route('articles', function() { 
     this.route('show', {path: '/:id'}); 
    }); 
    this.route('contact'); 
    }); 
}); 

おかげファイルです。

+0

質問に実際のコードを貼り付け、質問内のコードで何をしようとしているかを説明することを検討してください(例:「メインルートのポッドディレクトリを削除できますか? ")。画像はそれには素晴らしい補足ですので、私はそれらのリンクを残したいと思います。 –

答えて

0

あなたのmainルートはpath''とすることができます。

this.route('main', { path: '' }, function() { 
    this.route('about'); 
    // etc... 
} 
+1

ありがとうChirs。それがそれを解決しました。とても有難い。あなたのご意見を参考に、オリジナルのrouter.jsコードを質問に追加して他の人を助けました。 –

関連する問題