내 레일 애플 리케이션에서 groups
이라는 리소스에 회원 경로를 만들었습니다. 나는이 항공사는 레이크 할 경우레이크 경로에 따라 존재하는 경로에 대한
resources :groups do
member { post :vote }
end
, 그것은이 경로는 엠버에서
vote_group POST /groups/:id/vote(.:format) groups#vote
을 존재 함을 보여주고, 나는, 그러나, 나는 양식에 제출 클릭 GroupController
App.GroupController = Ember.ObjectController.extend({
actions: {
vote: function() {
$.post("vote_group_path", {
username: this.get("username"),
id: this.get("id")
....
을 생성 경로 없음 검색 오류가 발생했습니다.
ActionController::RoutingError (No route matches [POST]"/vote_group_path"):
ID 포함을 통해 그룹을 지정하지 않기 때문에 이것이 궁금합니다. 각 그룹을 보여줍니다 템플릿, 나는 이름과 ID
<script type="text/x-handlebars" id="group">
{{ model.name }}
{{ model.id }}
{{ partial 'groups/form'}}
</script>
를 표시 할 수있어하지만 난 형태로 숨겨진 요소의 종류와 그룹에 대한 id
를 (포함하는 방법을 잘 모르겠어요 그)
<script type="text/x-handlebars" id="groups/_form">
<form class="form-horizontal" {{action "vote" on="submit"}}>
<div class="controls">
{{input value=username type="text"}}
</div>
<button type="submit" class="btn">follow</button>
</form>
</script>
을 경로 작업을 할 경우에도 필요하다면 나는 그룹 컨트롤러의 투표 행동 그룹 ID를 필요로 결국거야 알고 있지만, ID의 부족이 만드는 있는지 확실하지 않습니다 경로가 존재하지 않는 것처럼 보입니다.
def vote
@group = Group.find(params[:id])
...