similar to: javascript_include_tag and controller actions

Displaying 20 results from an estimated 20000 matches similar to: "javascript_include_tag and controller actions"

2006 Jan 29
2
GetText and rjs templates?
hi, is it possible that gettext don''t work with rjs templates? i''ve just tried this simple example blog_controller.rb : class BlogController < ApplicationController def index end def dosomething end end index.rhtml : <html> <head> <%= javascript_include_tag :defaults %> </head> <body> <div id="test">Some text to change
2007 Jan 04
0
javascript_include_tag emits self-closing <script> tag
hello, here is a sample rhtml: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head><%= javascript_include_tag :defaults %></head> <body>test</body> </html> the
2006 Nov 02
2
Update map
Hi! I''ve just started playing around with the ym4r-plugin and try to update a map as explained in the README-example... but nothing happens. I can update normal html. Heres my baby-code: class AdminController < ApplicationController def index @map = GMap.new("map_div") @map.control_init(:large_map => true) @map.center_zoom_init([59.91106, 10.72223],16)
2006 Jun 17
2
RJS templates - newbie
I am trying to test drive RJS templates in Rails 1.2. Here is what I did: create table categories (name varchar(255) ); rails RJSTest cd RJSTest rake update_javascripts script/generate controller home index add script/generate model category Note: When I did a rake update_javascripts, I did not see any output. I configured database.yml to talk to mysql. Next I wrote
2006 May 12
0
RJS, Safari, Error - DOM exception 7
I''m having nasty cross-browser headache. Not new to Rails, but quite new to AJAX/RJS. My app works perfectly in Firefox, but generates the error in the subject line in Safari. Pretty simple circumstance, completely reproducible in all cases: Any ideas? Relevant code attached. Layout: ------- <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC
2010 Nov 04
0
Re: Train wreck getting render_to_string to work from foreign controller [SOLVED]
Just for collective knowledge as I have found no info on this problem online: I solved this by adding an .html.erb file for the "missing template", since by design or bug Rails3 will not find or render another controllers view (in my experience). Then in the new html.erb file, I just put <%= render "comparisons/display" %> because the views *are* able to find templates
2006 Apr 07
3
RJS removing content of div, but not div itself
Hi, I''m creating a list of ingredients on a page. When the user clicks the ''Add Ingredient'' button a record gets added to the db and the ingredient gets added to the page. On the page, each record is represented by a <div> with three <span>s inside. One of the <span>s has a link_to_remote to ''delete'' the ingredient. When the link
2006 Jul 06
2
rjs rails to execute?
I have the following: layout: <%= javascript_include_tag :defaults %> [...] <div id="menu"> <div id="myrandom"></div> <%= render :partial => ''menu'' %> </div> menu partial: <%= link_to_remote "Generate Text", :update => ''myrandom'', :url => { :action =>
2005 Dec 31
9
RJS Templates not conducting callbacks
I''ve run across a weird problem with RJS that I''m trying to figure out: I have an application that was running 0.13.1 that I recently upgraded to Rails 1.0. I wanted to use RJS templates, so I installed the plugin and updated my prototype javascript file via ''rake update_prototype.'' I attempted to test the templates out via the following code, but the AJAX
2005 Dec 19
1
Preserving fallback with RJS
Hi guys, I really like RJS. I think they''ll replace partials in alot of instances. Unfortunately, because they''re automatically used like .rhtml and .rxml and are hard to specifically specify it makes it messy to preserve fallbacks when using them. For instance, using partials instead of rjs, my create method might look like: def create post = Post.new(params[:post]) ...
2008 Oct 31
2
Stubbing #javascript_include_tag in a helper spec
When writing specs for a helper method, how do you set an expectation for #javascript_include_tag ? describe NeighbourhoodsHelper do describe ''#initialise_map'' do it ''should include the "foo" JS file'' do # expectation here helper.foobar end end end I''ve tried replacing "# expectation here" with the
2011 Oct 12
4
How to access controller's instance variable in a js.erb loaded by javascript_include_tag?
Hello! In rails 3.1 app I have a controller UsersController with ''show'' action. show.html.erb contains: <% content_for(:head) do %> <%= javascript_include_tag ''myscript'' %> <% end %> <p>Hello @user.name</p> And I have this in myscript.js.erb $jQuery(document).ready(function() { alert(<%= @user.name %>); }); @user is being
2006 Jul 03
2
rjs renders string or partial but not template or action
Hi, I have an rjs file. I only have one controller called called front. I have views called "new_title.rhtml" and "_new_title.rhtml" These work page.replace_html ''title'', ''new title'' page.replace_html ''title'', :partial => ''new_title'' page.replace_html ''title'',
2007 Sep 20
2
Rendering a partial from within that partial
I am having trouble rendering a partial called ''names'' through a submit tag located within that partial. The form data is saving with my current code. However, the existing data is not loading into the form and the partial is not being re-rendered upon submission to reveal the changes to this data.What might I do to fix this? show.rhtml <%= javascript_include_tag :defaults
2006 May 02
4
passing data from controller to rjs and then to partial
Hello Experts, I am fetching data in my controller from a web service def search response = @@api.DoSearch() end and in my .rjs template, I am doing page.replace_html ''fields_chooser'', :partial => ''fields_chooser'' ,:locals =>{:response => response} page.visual_effect(:Appear, ''fields_chooser'') and in _fields_chooser.rhtml, I
2006 Aug 30
10
respond_to not detecting JS turned on. form_to_remote problem?
I''m trying to use respond_to to redirect visitors who have JS turned off to a different page. The problem I''m having is that respond_to is sending *everybody* there. It''s not recognizing that JS is turned on in the browser. The wanted_html.rhtml file below is rendered whether I''ve got JS turned on or off. I''ve looked at the Accept headers being sent
2010 Jun 02
1
Ajax with JQuery
I have used Ajax link and live validation in index.rhtml Ajax link requires JavaScript "prototype" and live validation requires "jquery". i got "element.dispatchEvent is not a function" on the firebug console when i used "prototype" and "jquery" in same page index.rhtml after i removed javascript "prototype" library, i got "Ajax is
2006 Apr 07
6
Multiple view types for a single action?
Is it possible to have more than one kind of view for a specific action, for example an .rhtml and a .rjs file to handle the view for the same action? I suspect not, but this makes me wonder if there a way to call the .rjs file from within the .rhtml so the statements within it get executed? Thanks, Andy
2006 Mar 14
7
Starting with RJS - not working
Hi, I''m trying to work with RJS and folowed Cody Fauser''s tutorial (http://www.codyfauser.com/articles/2005/11/20/rails-rjs-templates) I''ve started by creating a new rails applications and executing rake freeze_edge rake rails:update:javascripts rake rails:update:scripts After that I''ve created a controller: class DtestController < ApplicationController
2006 May 30
2
No rhtml, rxml, rjs... problem with Action Mailer, again
Hi all I have seen a lot of people writing my same problem but I haven''t found the solution yet. This is the problem: "ActionView::ActionViewError in Periodico#index No rhtml, rxml, rjs or delegate template found for..." when trying to send email through action mailer. I have created the Notifier.rb model (in app/models/ folder) def signupthanks(user) # Email