similar to: Setting focus in a rhtml view

Displaying 20 results from an estimated 10000 matches similar to: "Setting focus in a rhtml view"

2008 Mar 17
9
Render index view and RJS on load?
Hi, I''ve searched for a while online and been unable to find anything concerning this. I have a controller with an index action, which has an index view. This view renders the index page but also needs to execute some javascript to show some data (using effects) when the page loads. I thought I could just create the view and RJS with the same name and the RJS would be run after the
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 Aug 17
2
RJS - slower than normal RHTML?
I know that isn''t supposed to be the case, and it usually isn''t, but today, I''ve run across a situation where rendering the same partial through RJS is taking about 5 times longer than rendering the partial in the RHTML. I have in my main RHTML <tbody id="account_transactions"> <%= render :partial =>
2007 Jun 25
2
passing parameters from rhtml to rjs
I need some parameters to go from my rhtml to my rjs. Anyone know how to do this? -- Amos King A. King Software Development and Consulting, L.C. http://dirtyInformation.com -- Looking for something to do? Visit http://ImThere.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
2006 May 02
5
How to call a javascript function from rails view?
Is there a way to call a javascript function from within a rails view? I can''t use the onLoad javascript method inside the <body> tag because I don''t have control over the body tag, it''s in my header. There are several rss feed reading functions that are in the page and I would like to call those functions while the page is being loaded or once it''s
2006 Apr 25
8
Does Rails suppports XHTML for views for inline SVG''s?
I have following piece of code(which when saved in a file with .xhtml extension and opened in Mozilla 1.5.0.2 works fine); <html xmlns="http://www.w3.org/1999/xhtml" xmlns:svg="http://www.w3.org/2000/svg"> <head> <title>SVG within XHTML Demo</title> </head> <body> <p> You can embed SVG into XHTML, provided that your
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 Mar 31
5
RoR 1.1 RJS problem
I''ve been playing with the new RJS stuff in RoR1.1, and I have to say that I''m am extremely impressed, NICE! work guys. However, I seem to be having a bit of a problem. I promise, I''ve googled the hell out of it and haven''t found an answer. Set up: Putting together a little proof of concept app. Display a form (index.rhtml) that just has a button to
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
2008 Aug 24
11
link_to_function check javascript attribute
How could I check the value of an javascript object''s attribute? <div id="new_item_details" style="display:none"></div> <%= link_to_function("Show details...", nil, :id => "show_details") do |page| page.visual_effect(:toggle_blind, :new_item_details) if (page[:new_item_details].style.visibility ==
2006 May 31
3
One RHTML file
I am making a simple app which has just a few screens and I would like to do it with a single html file. The file has all of the difffernt componants of each screen in hidden div''s which I want to make visible and place as the visitor moves through the site. I can see that RoR has the ability but I am not quite getting it. The path is roughly login -> modify account -> submit
2006 Jul 20
6
replace_html + javascript
Hi all, This is my first post to the list, so I hope it gets through and I don''t do anything wrong :) Here''s the issue I''m having... I have an rjs that''s doing: page.replace_html ''myid'', :partial => ''my_partial'' And in my my_partial I have: <script type="text/javascript">
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 =>
2006 Apr 07
3
Ajax render a template
In my blog a user can add comments. I want an Ajax call to add the comment to the bottom of the comments list. How to i return a comment thats is in the comment template and add it to the bottom of the page. I have gotten as far as rendering some text back to the form and the comment doesn''t display until i refresh. This is my _newcomment.rhtml form to create a new comment <div
2006 Jul 16
3
RJS problem
I have an odd problem while trying to use a simple rjs. _test.rjs : page.alert "test" test.rhtml: <script><%=render_partial(''test'')%></script> When I am attempting to view controller/test the page comes as if it was a text file. So i am actually seeing: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2005 Dec 24
2
Ajax Help: Multiple Updates - ?
Hi! Wondering if anyone can tell me what''s wrong with my code? I''m trying to use the onChange event of a select list to update multiple divs... Agile Web Development with Rails (p. 403) suggests using ":complete => eval(request.responseText) instead of :update" I''ve attempted the following test code: # in the view <select name="plist",
2005 Dec 30
11
Losing my mind with Ajax link_to_remote
I''m playing around with Rails, and I can''t get this to work. I just can''t seem to wrap my brain around it. I''m having some trouble doing an Ajax navigation column. Here''s what I have: view layout: <div id="navigation"> <%= render(:partial => "navigation", :collection => @categories) %> </div> My
2006 Jul 27
17
How do you stop a Ruby method from executing?
Hey guys, How do you stop Ruby code from executing? For example, def newaction puts "1" return puts "2" end I tried return in the following example, but it continues and than looks for newaction.rhtml. How do I stop it completely dead in its tracks? -- Posted via http://www.ruby-forum.com/.
2006 Mar 13
3
problem updating mulitple divs with ajax
i''m having some issues updating multiple divs via ajax. perhaps someone can lend some assistance. i''ve got 2 divs: user_list and user_form. when a person clicks the "edit this user" or "add new user" link the user_form div is updated via an ajax call and the form is shown in the user_form div. this form is a remote form. it submits to either the update
2006 May 05
6
RJS implementation question
Why is RJS so dependant on programatic creation of Javascript? RHTML is a great implementation in that it puts HTML first, and Ruby second. I would have thought RJS would be the same way: a .js with ERb helpers for generating Javascript functions. RJS putting Javascript second means: - I have to learn a whole new set of commands to use Scriptaculous. - Developers have to constantly chase the