Ajax issue with rails

$(".sub123").click(function() {
var mnum = $("#mnum").val();
var dataString = ‘value=’+ mnum;
if(mnum==’’)
{
$(’.error’).fadeIn(300).show();
$(’.error’).fadeOut(3000);

}
else
{

$.ajax({
type: “GET”,
url: “http://localhost:3000/pages/show/”,
data: dataString ,
success: function(){
$(’#billerTerminal’).fadeIn(200).show();
$(’.checked3’).fadeIn(200).show();
$(’.error’).fadeOut(200).hide();
$(’.adddtl’).hide();
}
});
}
return false;
});

In the above code when i call url *http://localhost:3000/pages/show/,
*the
functionaly will do in show method in pages controller, and get some
results. So i need to update the result, which getting from show method
with div id #billerTerminal…???
*
*
thank you
vishnu

On 16 May 2012 11:55, amvis [email protected] wrote:

{
}
});
}
return false;
});

In the above code when i call url *http://localhost:3000/pages/show/, *the
functionaly will do in show method in pages controller, and get some
results. So i need to update the result, which getting from show method
with div id #billerTerminal…???

So how far have you got? What does your controller look like? What is
the
problem you are having?

On Wednesday, 16 May 2012 07:24:36 UTC-4, iHiD wrote:

$(’.error’).fadeIn(300).show();
success: function(){
In the above code when i call url *http://localhost:3000/pages/show/, *the
functionaly will do in show method in pages controller, and get some
results. So i need to update the result, which getting from show method
with div id #billerTerminal…???

Class pagesControlller

def show
@name =“name1”
@name2 = “forname”
end

def page
end

end

page.html.erb

<%= form_tag({:controller => 'pages',:action => 'show' }, {:method => :get}) do %> <%= text_field_tag('mnum' ,nil, :class => "input-xlarge",:style => "text-align:center;height:28px;background-color:#dff0d8;",:placeholder => "Enter Mobile Number") %> <%= submit_tag "Get", :id => "getpage", :class => "*sub123* btn btn-large btn-primary" %> <%end%>

*<%= @name %>*

The problem is when i click the button with id *sub123, *call the ajax,
and
go to the url, there i can find the value of @name, so the when the ajax
is
success i have to display that *@name into the div with id *
billerTerminal…?