Displaying 20 results from an estimated 8000 matches similar to: "Render index view and RJS on load?"
2006 May 17
4
.rjs templates undesiered output problem
Hello everyone, I am working with rjs templates in rails, and I''m amazed
of how simple it is to generate code with ajax, however I''am having some
troubles and I can''t seem to find a way to solve''em.
Whenever I put some code in the template, let''s say:
page.visual_effect :highlight, ''sitio37'', :duration => 3
I get 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 18
3
RJS templates for DOM manipulation
I want to do some DOM manipulation with JavaScript. Specifically I
want to implement zoom in/out in a picture by changing it''s
width/height attributes. Is it possible to do this using RJS or should
I write javascript by hand?
All the examples of RJS I''ve seen write the javascript in the result
of an AJAX remote call. Where are the docs for RJS? All I''ve seen are
blog
2009 Jul 12
3
RJS render errors when user clicks away before render completes
We have an issue where we are using RJS templates to render the
results of Ajax calls. Everything works fine so long as the user
waits for the render to occur. However, if the user initiates the
request and the RJS template is still in the process of rendering, but
hasn''t completed, and the user clicks a different link, then we get a
Javascript alert popup "Unexpected Server
2006 Dec 05
5
Render :update and script tags
Hi All!
I''m kind of new o ruby so please apologize my stupid questions on
advanced...
I''m using
render :update do |page|
page.replaca_html :element , :partial => ''apartial''
end
This is working well, since I see in the page the following code:
try
{
Element.update("element", "");
} catch (e)
{
alert(''RJS
2006 Jul 19
3
render :partial inserting new line in RJS
Struggling a bit with rendering a partial in an RJS template. I''m having
to feed the javascript directly to the page object as couldn''t find a
way to have insert_html work directly on the proxy object returned by
select.
However, that''s not the problem. The code for doing that is below and it
all works fine, except that a new line is being inserted after the
2006 Aug 09
2
Can :before and :success move from view file into .rjs file?
Within the RJS template is there a way to specify when the visual_effect
should occur?
I''m trying not to repeat the :before and :success blind_down
visual_effect statements throughout my views.
It seems like the rjs templates can only take visual effects statements
in the form of
page.visual_effect :blind_up, ''divname''. I can''t figure out how to add
2009 Apr 03
7
RJS not rendering correctly when mime-type is 'iphone'
I have an iPhone version of my site, and for some reason none of the
rjs works when viewing the iPhone version. This happens instead:
ActionView::MissingTemplate (Missing template controller_name/
update.erb in view path app/views)
The rjs works fine when viewing the site normally, and it worked when
viewing the iPhone version prior to upgrading Rails to 2.3.2.
Additional info: I have
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 Jul 16
7
RJS and Action Renders but page doesn''t update
All,
I am trying to perform a simple ajax task and am having some difficulties with the page showing the response. The action performs, but no response on the page.
I have found examples on the web and I believe I have copied and pasted exactly what works from the demo site. However, on my system it isn''t finishing. For a simple test, I have limited it down to an alert.
2006 Jan 13
1
Rendering an RJS template within another RJS template
Is there a way to render an RJS template within another?
I''ve put my simplified code below. No errors are generated, but the
partial isn''t rendered. I also tried using render :action =>
''update_actions''
destroy.rjs---
page.visual_effect :fade, comment_container(@object.id.to_s)
# update the number of comments(below is another rjs template)
render :partial
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'',
2006 Apr 08
2
Cannot use view helpers in RJS helpers
Any ideas why I would get an error in a RJS helper on view helpers
such as number_to_currency.
Example:
# my_template.rjs
page.help_me
# my_helper for my_controller
def help_me
number_to_currency(10)
end
I have also tired page.number_to_currency but that doesn''t work either.
Cheers,
Nicholas
2006 Jun 13
5
strange RJS behavior
I used RJS extensively in my last web app with no problem.
I''m just beginning a new one and having a very odd problem.
The called method, get_names, retrieves some values from the database,
then ends:
render :layout => false
the get_names.rjs file is rendered into Javascript, but then is just
dumped as Javascript (text) into the browser:
e.g:
try {
2006 Jun 16
2
RJS replaces JavaScript?
Hi All,
I am currently devleoping a Rails application and I need to do following as
part of client side operations,
1. HTML Form validations
2. AJAX
I am currently calling Javascript methods from views of my application; I
heard about RJS(Remote Javascripts) templates; are the replacing Javascript
altogether? can I use RJS for HTML Form validations and AJAX?
What I believe is that with RJS
2006 Aug 18
1
controller is to app.rb ; view is to layout folder ; rjs template is to ??
any help with this analogy? i have an rjs template that goes along with a method
i have in application.rb and the functionality will be used from many diff
controllers (the method take a tag as param to accomplish some AJAX
acrobatics).. just trying to stay DRY here. is there no other way other than
sticking the same rjs template in each view folder that uses this functionality?
i guess i could do
2006 Apr 22
3
rjs woes, any hints?
I''ve pared my rjs experiment down to what seems a bare minimum. When I click
on my link_to_remote, the rjs executes, returns the correct javascript to
the browser, but it doesn''t update the div I''ve specified. What appears to
be coming back from the controller is:
Element.update("my_form", "hello, rjs");
I''m tearing my hair out.
2006 Apr 23
3
RJS not sent as text/javascript
I''ve made a couple of other posts about this and finally figured out what was
wrong. For some reason, the RJS response was not being sent with a content
type of "text/javascript" (which it should be, per the dox). The following
line in each controller method that renders RJS makes my app work:
@headers[''Content-Type''] = ''text/javascript''
2006 Apr 16
11
RJS templates not found
I am running Rails 1.10 and wanted to check out the RJS templates.
Rails doesn''t seem to find them.
I did issue the rake comment update_javascripts and that did not correct
the problem. RJS is part of 1.1 right?
Any ideas?
Thanks.
--
Posted via http://www.ruby-forum.com/.
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