I am building a task management application in ROR. I am new to ROR and
learning it. While adding tasks, I need to select a projects drop down
list and the team members of that project will be shown as drop down. I
am using ajax for it. But I see that in the response data I am getting
the complete htmls with header (not only the drop down htmls). Please
help.
function getComboA(sel)
{
var value = sel.options[sel.selectedIndex].value;
$.get("/users_projects?id="+value,function(data) {
alert(data);
$("#user_1").html("<label>User Details</label>"+data);
});
}
=============Task Controller=================
def users_projects
@projs = ProjectsUser.find_all_by_project_id(params[:id])
@users=[]
@projs.each do |pro|
@users<<User.find(pro.user_id)
end
end
I am building a task management application in ROR. I am new to ROR and
learning it. While adding tasks, I need to select a projects drop down
list and the team members of that project will be shown as drop down. I
am using ajax for it. But I see that in the response data I am getting
the complete htmls with header (not only the drop down htmls). Please
help.
function getComboA(sel)
{
var value = sel.options[sel.selectedIndex].value;
$.get("/users_projects?id="+value,function(data) {
alert(data);
$("#user_1").html("<label>User Details</label>"+data);
});
}
=============Task Controller=================
def users_projects
@projs = ProjectsUser.find_all_by_project_id(params[:id])
@users=[]
@projs.each do |pro|
@users<<User.find(pro.user_id)
end
end
I am building a task management application in ROR. I am new to ROR and
learning it. While adding tasks, I need to select a projects drop down
list and the team members of that project will be shown as drop down. I
am using ajax for it. But I see that in the response data I am getting
the complete htmls with header (not only the drop down htmls). Please
help.
You need to specify to render without the outer layout in your
controller:
render :layout => false
Walter
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.