Displaying 20 results from an estimated 100 matches similar to: "Ajax render a template"
2006 Apr 11
5
RJS adds comment but doesn''t update form
Hi,
When a user adds a comment i want to add the comment to the end of the
comments list using ajax so there is no full page refresh. The code i
have below adds the comment to the database but doesn''t update the
comments div with the new comment.
Can anyone help? This is my first use of rjs templates and i have read
http://www.codyfauser.com/articles/2005/11/20/rails-rjs-templates
2006 Apr 01
10
You have a nil object when you didn''t expect it!
Hi,
I am creating a blog to learn ruby on rails.
I have 2 different views/models/controllers, 1 called post and 1 called
comments. How do i link a post from the views/post directory to the
comments that belong to the post in the views/comment directory.
This is the code in the post/show.rhtml
<%= render :partial => "post", :object => @post %>
<%= link_to
2007 Mar 06
10
Windows rspec "gem install win32console"
Hi,
Hi I am trying to use RSPEC on windows and i keep getting the following
error
"You must gem install win32console to use colour on Windows"
I have installed this Gem but i am still getting the same error. The
file that error is coming from is:
C:\ruby\lib\ruby\gems\1.8\gems\rspec-0.8.2\lib\spec\runner\formatter\base_text_formatter.rb
Do i need to put this line of code in? Where
2006 Apr 15
8
Instant Rails on Win XP SP2
I am trying to run instant rails on windows xp SP2. I can get the
cookbook and typo sample sites to work with webrick but not with scgi.
When i click the start with scgi i get a blank dos window and typing
www.mycookbook.com returns
Firefox can''t establish a connection to the server at
www.mycookbook.com.
This suggests that apache is not even running even though the green
light is
2007 Mar 01
4
RC1, Rails, and problems with multiple options in spec.opts
I am having inconsistent output with multiple options in the
spec.opts file. I can, for instance, pass --color or --colour, or,
separately, use --drb. But when combining them I get:
/opt/local/lib/ruby/1.8/optparse.rb:1381:in `complete'': invalid
option: --options --color --drb (OptionParser::InvalidOption)
from /opt/local/lib/ruby/1.8/optparse.rb:1379:in `catch''
2006 Aug 04
3
Pass a variable via Link To
Can anyone tell me how to pass a value from a link_to in a view to a
controler?
The value is just a piece of text for the time being.
<%= link_to ''About Us'', :action => ''about'', :params => ''string'' %>
???
--
Posted via http://www.ruby-forum.com/.
2006 Apr 03
8
Layout problem
Hi,
I am creating a blog to learn ruby on rails. The blog.rhtml in the
layout folder has a the following code
<td width=150 valign="top">This is the left menu</td>
<td width=600 valign="top"><%= @content_for_layout %></td>
<td width=150 valign ="top"><%= render :partial => "categorylist",
:collection =>
2006 Aug 14
4
Controller method problem
Hi,
I have a def in my controller see below where i want to find the page
object based on a parameter value and then use the page_id to then find
all the contents that belong to that page in the same method.
Controller
def aboutus
@page = Page.find_by_name(params[''About Us''])
@contents = Content.find(:all,
:conditions => "page_id = #{@page.id}")
end
2006 Apr 12
4
Instant Rails SCGI Problem
I have installed instant rails and configured it
http://instantrails.rubyforge.org/wiki/wiki.pl?Getting_Started
I can get typo and webrick to work on webrick localhost:3000 but cant
get anything to work with scgi.
When i start the scgi server i get a blank dos window screen. When i
type www.mycookbook.com into the browser i get the following
Unable to connect
Firefox can''t
2011 Jul 09
2
Zip files on Amazon s3 bucket
Ive recently moved my files to amazon S3 storage. There is some
functionality to allow an archive of files to be downloaded to a user
via delayed job. So basically a project may have 10 documents in 10
different folders in the s3 bucket. What i need to do is zip the
files up into one zip file and then send the user a link to download
them. Im using https://github.com/qoobaa/s3 and paperclip to
2008 Sep 29
4
RJS is not loaded
Hello,
I have here an issue which is really critical for me (it for my
university work and I would like to not delete this feature). It based
on a Rails 1.x tutorial which I use now under Rails 2.x. It contains the
refreshment (adding content or records) of an div via RJS/JS.
I access the RJS via (Controller):
respond_to do |format|
format.html { redirect_to :controller =>
2011 Oct 10
2
nested attributes question
Hi,
I have a product that has many photos, so when creating a new product
the user can upload as many photos as they want. This all works fine
using nested attributes for. I want the user to be able to set one of
the photos as the default/primary photo, so i have played around with
using a radio button to decide which photo to select as the default
but i cant seem to figure out how to save this
2006 Apr 05
7
Archive monthly count for blog
I am creating a blog to learn ruby on rails.
from the layout page i pass all the posts as a collection to
_archive.rhtml
<%= render :partial => "archive", :collection => @archive %>
On _archive.rhtml i have access to the collection. I am then gone to
render partial another page _archivecount.rhtml to display the number of
posts for each month.
Can anyone give a clue
2006 Jan 04
9
Resizeable
Has anyone done any work on a "Resizeable" class they''d be willing to share?
I''m looking to do some stuff that''ll need resizable divs, but I didn''t want
to re-invent the wheel if I can avoid it.
-Jerod
_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
2006 Aug 14
1
Overide the default find_all
Hi,
In my model i want to overide the default find all for sorting purposes.
Is this possible or can this only be done in the control or by adding a
custom method in the model.
def self.find_all()
@contents = Content.find(:all,
:order => ''pos, position_id'')
end
--
Posted via http://www.ruby-forum.com/.
2006 May 18
2
Lighttpd scgi error on windows
Hi,
I have followed the instructions below to get lighttpd and scgi working
on windows.
http://wiki.rubyonrails.org/rails/pages/HowToDeployWithLighttpdOnWindows
When i typ in the following address http://127.0.0.1:9999/ i get just a
blank white page.
In the scgi.log file i have the following error but dont know what the
problem is
[INF][3552] Running in production mode on 127.0.0.1:9999
2006 Apr 11
1
Apache configuration problem
Ive installed apache2triad on my windows xp machine. I have followed
the instructions on
http://wiki.rubyonrails.com/rails/pages/Fast+CGI+and+Apache2+for+Windows+XP
When i open a browser and type http://localhost/blog/ i get a file
listing directory with all my rails application folders inside the page.
If i click on the public folder i get the Welcome to rails web page.
Can anyone help?
2006 Aug 03
1
RadRails install plugin problem
Hi,
I''m having a problem installing plugins in the latest version of
radrails running on windows XP.
I used the Plugin window in radrails to select file_column to install
file_column and everything worked ok.
Now i want to install remote_upload plugin which isnt in the plugins
list contained in radrails. So i select plugin from the generators tab
and type remote_upload and hit
2006 Aug 16
3
Validate your forms with a table-less model
Ive followed this example of how to validate a form with a tableless
model:
http://rails.techno-weenie.net/tip/2005/11/19/validate_your_forms_with_a_table_less_model
Ive got this example working but when validation fails the failed boxes
are not highlighted in red. At the moment i have a contact details form
and want to validate the information entered by the user but this will
just result
2009 Mar 11
12
Eager loading comments associated with user submissions.
Hey everyone,
I am working on an application that allows users to submit articles,
and also comment on those articles. Pretty much exactly like Digg.
Everything works fine except that when there are a lot of comments
there are a lot of database queries to both fetch the comments and the
users who posted those comments. I have used eager loading in other
parts of my application to reduce the