Displaying 20 results from an estimated 40000 matches similar to: "Access instance variable in ajax rendered by controller - Rails"
2013 Mar 06
2
Refresh a partial onClick using ajax call in rails 3.x
Hi All,
I want to refresh a partial onClick, onClick i am making ajax call
and getting the data but i am unable to refresh the partial. here is the
code
IN views: home.html.erb
$(document).ready(function() {
var currentCellText;
$(".inline").click(function() {
currentCellText = $(this).text();
$.ajax({
type: ''GET'',
dataType: "json",
2013 May 27
6
Headache with Ajax in Rails using jQuery
Hello everyone, I''m a newbie at Ruby on Rails. I spent nearly two days
of the Memorial Day weekend stumbling upon making Ajax working in Rails.
At this point, I''m so exhausted and hope that I can get some help to
move forward. I have tried nearly everything I found on Google but
still not successful. Initially, I tried the Ajax approach offered by
Rails but did not work, so I
2012 Oct 09
10
Auto refresh the drop-down
I have an option in dropdown like "Add new option" written using
grouped_collection_select.
And when user clicks on the "Add new option". A pop up dialog appears to
add a new value. And when I click create it hits the database and adds the
value to the db.
But It never updates the dropdown list. Suggest me a way to auto refresh
only the current dropdown with the new
2012 Aug 07
4
how to do render partial on jquery ajax success method with rails 3
I''m using rails 3.2.1 with jquery for an ajax call.
My juqery code is :
jQuery.ajax({
url: "/org_pages",
data: ''org_id=''+ org_id,
type: "POST",
success: function(result){
jQuery("#image_center").html("<%=
escape_javascript(render(:partial =>
2012 Nov 30
1
q@ request.request_method=='OPTIONS', ajax, post json
hi
im reading through the topic above and trying to apply it to my app.
as reference i found:http://leopard.in.ua/2012/07/08/using-cors-with-rails/
my prob is that i dont see the ''preflight'', meaning the first request
prior the actual post, which should(?) deliver this:
request.request_method==''OPTIONS''
the js code look like this:
$.ajax
({
type:
2012 Mar 26
3
render :json not sending any data back ...
[rails 3.2.2]
I perform an ajax call :
...
$.ajax
url: " /backoffice/expenses/rate"
type: "GET"
dataType: "json"
data:
project_id: $(''#project_id'').val()
code: $(this).val()
success: (result) ->
alert result
$(''#expense_price'').val(result)
in
2012 Dec 05
1
Ajax response in a modal box
Hello guys,
I was wondering if I could display the ajax response in a modal
box. I could not find anything satisfying on the web. I am new to ajax.
This is what I was trying.
$(document).ready(function() {
var clicked1;
$(".inline").click(function(e) {
clicked1 = $(this).text();
$.ajax({
type: ''GET'',
url:''/controller_path'',
async: false,
2011 Sep 06
8
Ajax and rails 3 UJS (jquery)
Hi, guys,
I''m in the midst of moving an app from rails 2.3.8 to rails 3.0.9.
Sadly, rails 3 no longer has javascript generators and I''m now forced
to do more javascript.
For my project, I have selected jQuery as the javascript framework for
my rails 3.0.9 app.
What I have done to have my app''s deletion link (for each item)
trigger an alert box when the deletion
2013 Nov 14
10
Render to clear textbox
There has to be a better way to do this. What I am trying is not working,
and seems convoluted. Essentially, a controller method is called, and exits
by rendering a partial the purpose of which is to simply clear a textbox in
the view. So I am calling the partial which established the textbox -- but
it doesn''t work (i.e. it doesn''t clear the textbox). Does anyone know of a
2013 May 17
5
Active Admin with Ajax call
Hello everyone. I''m begining with Ruby on Rails, and i''m facing some
trouble with "ActiveAdmin with ajax."
Here''s the situation:
It''s a Kennel''s web site, so, while i''m creating a new dog, i have one
select/options for the dog''s father, dog''s mother, and dog''s race.
After select the dog''s
2012 May 21
4
Rendering partial views with ajax calls in rails 3.1
I''m starting now with rails, and i have simply question i think.
I need to render two partials in one ajax call:
I have the following controller:
# GET /hosts/1
# GET /hosts/1.json
def show
@host = Host.find(params[:id])
respond_to do |format|
format.html #show.html
format.js
format.json { render :json => @host }
end
2012 Nov 14
8
right click or Context Menu in ruby without javascript
Hi,
This query is a replica of the link
http://railsforum.com/viewtopic.php?id=51231.
As I was unable to get any replies from the rails forum, I am posting
the same here.
I have developed an app using Rails 3. I have a table made to look
like a calendar. I wanted to know if there were any methods or gems to
acheive right click(context menu) action on the dates WITHOUT
javascripts or
2013 Jan 09
4
CSRF resets my session in Firefox
Hello all,
I''ve been trying to diagnose an issue with CSRF and Firefox
specifically. I''ve got an ajax based form, using UJS (yes, I have
csrf_meta_tag in my layout and I''ve tried adding the X-CSRF-Token header
to the ajax beforeSend events without any luck)... The form just posts
some data to an ajax method that creates, saves, and sets the session
for a shopper as
2012 Dec 13
23
make rails connect with database
i''m newbie in rails. i have problem with how to connect rails with
database. before i can connect it with command
"rake db:create" to create database.
and "rake db:migrate" to migrate schema to database.
but, i want to connect rails with database that i have before, not
create it via rails. can you help me?
--
Posted via http://www.ruby-forum.com/.
--
You received
2012 Oct 01
12
Can I have Ruby on Rails without json
Hello,
On my Chakra linux machine the json gem would not get compiled,
I already made a issue for that.
But for continuing my project can I have ruby on rails without the json gem
?
And if so, how can I do this ?
Roelof
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to
2012 Oct 26
7
How to use Ajax with rails ?
Hi all,
Can any one tell me how to use Ajax with Rails.
Send me quick start up link and videos.
Thanks
Regards
Fahim Babar PAtel
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this
2012 Nov 12
7
RSpec: controller POST create
Rails 3.1.3
rspec-rails (2.11.4)
rspec 2.11.1
I am new to rspec. I don''t quite understand tests for POST create part.
I have generated scaffold, and simultaneously it generated
controller_spec.rb as well.
it "assigns a newly created plan as @plan" do
post :create, {:plan => valid_attributes}, valid_session
assigns(:plan).should be_a(Plan)
2010 Jun 08
8
rails, ajax, json, and script
Could someone please demonstrate the code to send both json (or xml) AND
javascript (to be executed) in a single Ajax request?
Is this even possible?
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to
2013 Jan 07
4
JSON::ParserError in controller
Hi All
I''m trying to build an application which requires to scrap information
from a webpage. On trying to perform the action, I get an error while
trying to convert the html data to JSON. Has anyone experienced this
before and if so can you please tell me how to solve this problem ?
Please see below for code snippet and error log.
Thanks in advance
Anush
require
2013 Jan 14
9
Need help even generating a new app
I''m having trouble even installing new rails apps. I get to the Bundle
run, and it errors on Json, here''s what my error says. I''m new to ALL of
this, including Terminal commands, etc. Hope someone can help me out.
Runs the Bundler.... then I error out at this:
"Installing json (1.7.6) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to