Displaying 20 results from an estimated 3000 matches similar to: "trouble with render :partial from controller"
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 May 08
17
partial problem
def my_controller
@variable = [{''myfield''=>''grey''},{''myfield''=>''blue''}]
end
#-------------------------my_view
<table>
<%= render :partial=>''my_partial, :collection=>@variable %>
</table>
#----------------------_my_partial
<tr>
<td><%=
2006 Jul 13
6
Render partial questions
Hello,
what is the preferred way to do this...
I have 2 controllers. Each has an index action.
Now I want to include the rendered index view from TwoController in the
index view of OneController.
But a render :partial doesn''t execute the TwoController index action
which sets variables for its index view.
So maybe you can give me a short example how to do it.
Thank you
Markus
2009 Apr 28
0
google adsense breaks render :partial =>
Hey everybody, i''ve got a control that returns a partial, no biggie.
Except when that partial contains the javascript for my adsense account.
Then the partial renders correctly, and then quickly replaces my page
with nothing by the ad. When i take away my adsense js, everything works
great. Has anyone encountered this before, or know how to get around it?
def submit_remote_form
render
2006 Aug 01
2
Partial Naming Madness
Hi, I am having the following issue with a partial. During initial page
load, I am doing a "render_partial_collect ''foo'', @foos", and all goes
well. Each foo partial makes use of a variable inside called ''foo'' (and
can get foo.id etc).
After all the partials are loaded, I need to :update a div corresponding
to one of the partials (ie re-load the
2008 Feb 13
6
trouble updating partial from collection
I have a view where I render a partial over a collection. Each instance
of the partial includes a <div> with an id specific to that instance.
Inside the partial, there is a select tag for "year". I''m trying to
change some of the contents of the partial when user changes the year.
I''m using this in the view:
<%= select_tag :year,
2006 Apr 13
2
acess local variables from helper?
if I call a helper method from inside a partial, it doesn''t appear to have
access to the partials local variables. is there a way to make them avilable
without passing them as parameters?
here''s a simple example
# in the view
<%= render :partial => "my_partial", :locals => :value => 2%>
# _my_partial.rhtml - raises "undefined local variable or
2006 Jun 22
4
rendering partials in layouts?
Hello all,
Forgive me if this is a really stupid question. How do you render
partials in a layout? It''s probably way easier than i believe it to be.
thanks!
--
Posted via http://www.ruby-forum.com/.
2006 Jan 10
14
Not wishing to instigate a DB war, but...
Can I get some opinions on which free DB to use with rails for a virtual
server that will eventually be doing lots of heavy database lifting?
Not a lot of heavy duty querying per se. Think multiple simultaneous
forums and blog sites and the like.
I know each of the different DB possibilities such as MySQL and
PostgreSQL has plus points and minus points. I''m particularly
interested
2008 May 15
4
render partial
hallo!
momentan steht meine seite so, dass ich gewisse dinge mit link_to_remote
auf bedarf nachlade.
was mach ich jetzt, wenn javascript deaktiviert ist?
kann ich das irgend wie mit render partial lösen? kann ich mit rails
prüfen, ob javascript aktiviert/deaktiviert ist und dann dahingehend
alle sachen sofort laden?
hat da jemand ansätze/strategien/lösungen parat?
danke!
--
Posted via
2006 Aug 17
3
Developing in different versions of rails at the same time?
Hi,
I was wondering if some of you have had to keep more than one version of
Rails on your machine at a time? If you have more than one customer,
they may have different requirements. You might need to work on a
pre-existing app that is not scheduled to be moved to a newer version of
Rails right now. How is the best way to deal with this?
thanks,
jp
--
Posted via
2006 Jul 13
2
Intel Mac, Rails, MYSQL - access denied
Hi,
Nuby on Rails here trying to bring up an existing app on a new
installation.
The whole ruby/rails/mysql/lighty installation was done per the much
touted "hivelogic article" that runs through all the steps.
I am running into a permission error when I try to do a rake migrate to
set up a session database needed by this existing app. Extracted from
the trace...
** Execute
2006 Apr 15
2
Using a Button to render partial
Is there a way to render a partial using a button? Basically in a
content div I want the user to launch a new sub content item in the same
div by clicking a button.
Any help appreciated.
Loving rails more and more everyday.
--
Posted via http://www.ruby-forum.com/.
2008 Feb 01
1
render partial in div
I have this link which when clicked will loop and render more links and
a form from a partial inside of "myDiv":
<%= link_to_remote ''MyLink'' . . . ., :update =>"myDiv" %>
<div id = myDiv>
<div>
<div>
<div>
What I am trying to do is have a form_remote_tag that re-renders the
list of stuff in "myDiv" when
2006 May 31
3
Should partials have access to the same var''s as the view?
I have a view, part of it I put in to a partial - a copy paste - but now
I get an error saying that there is an "undefined local variable or
method" in the partial code...
Do I need to pass my var to the partial, I would have though not?
Cheers AFM
--
Posted via http://www.ruby-forum.com/.
2006 Jul 23
6
how do you give focus to a form field?
When you put up a page with a form on it and the top item is a text
field it would be nice to have that field already focused instead of
forcing the user to click in it before they start typing. Is there a
rails (i.e. probably Prototype) way of giving focus to a field? I did
some searching and found nothing.
thanks,
jp
P.S. I''m on a Mac. Perhaps a winoze and/or unix automatically
2006 Jan 23
3
Can Google (et. al.) see rails pages?
Hi,
Noob here.
One problem faced by developers of active content is making sure that
the final results of their magic result in URL''s that Google and other
search engines are comfortable with. Otherwise, your content won''t ever
get spydered and indexed and ultimately returned in a google user''s
results pages.
In reading the agile rails book, it seems that the
2006 Apr 04
7
Not getting the whole RJS-based partial rendering concept ...
I have been trying all kinds of different ways to produce what I think
should be a simple effect, but have not had any luck yet and apparently
I am not following the general idea...
What I am trying to accomplish is the following (part 1 works and part 2
does not):
1. One of my views has a link_to_remote which updates a div container
with a table of data
my example is
<div
2008 Feb 29
0
RJS and EXTjs component update (RAILS 1.2.3)
I want to use an RJS view to update EXT Panel bodies. But since the
panel bodies
have generated element ids, I can''t see how to use
''page.replace_html''.
So instead I wrote a javascript function ''updateBody''.
In the RJS view, I want to say something like:
page.call ''updateBody'', ''some_panel'', :partial =>
2007 Mar 14
3
A place to put common partial templates and RJS files?
Greetings,
I have a partial template file (acutally, it is an RJS file but the
same principle is in question here) which I wish to "share" between
multiple controllers. Does anyone know where in the directory tree I
would put these files in order that I can access them from multiple
controllers in the same app? I really would prefer not having to copy
them all into all of the