Displaying 20 results from an estimated 2000 matches similar to: "plugin to add method to rjs "page" object"
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 Mar 14
2
RJS & Unicode (again)
I have a problem with unicode & RJS. I searched several boards & blogs,
but was not able to find a solution. Let me explain my problem with an
example.
View (test.rhtml):
...
<div id="a_test_div">?????????</div>
...
Output:
?????????
RJS-Template (an_action.rjs):
page.replace_html ''a_test_div'', ''?????????''
Calling
2005 Dec 15
0
RJS Templates and the Replace semantics
I have an issue with the way replace_html works in an RJS template.
This is a copy of a post on my blog (http://blog.craz8.com
<http://blog.craz8.com/> ) that describes the problem and my working
solution to the problem.
If I have a collection of things that are output like this:
<div id="things">
<% @things.each do |thing| %>
<%= render :partial =>
2006 Jan 19
7
validates_numericality_of positive integer
Hi,
What is the simplest way to validate a positive integer?
validates_numericality_of :foo, :integer_only => true
how do I add the positive part? Do I need another validation statement
for pattern matching or do I have to write a validate() funciton for
my model?
Thanks,
Peter
2006 Apr 26
10
save new model with child model
Hi,
I am having a problem saving a new model that has an associated child
model. If a new ticket is being created and will have one comment to
go with it then I tried this in my action
@ticket = Ticket.new(params[:ticket])
@comment = Comment.new(params[:comment])
@ticket.comments << @comment
if @ticket.save
@notice = "Ticket added. Thanks for
2006 Mar 22
14
currency conversion webservice in a rails app?
Hi,
I''m interested in using a currency conversion web service in my rails
app. Does anyone have a free service that they use and like? I found
this one
http://www.webservicex.net/WS/WSDetails.aspx?CATID=2&WSID=10
I''ve tried to make a simple, plain Ruby script to connect to this and
get a conversion rate without success.
How do I integrate a webservice into my rails app? I
2006 Jul 07
5
Can a route require POST or GET? / REST problem with routing
Hi,
A store front a customer wants to GET /product/5/show. But for the
application this is really GET /cart_item/new/5 or even better
/cart_item/new?cart_item[product_id]=5
When the customer clicks add_to_cart they POST /product/5/show so that
the url doesn''t confuse the user when any validation errors occur. But
for the applicaiton this should be POST
2006 Apr 01
4
problems getting ActionMailer working (on server)
Hi,
I''ve read the Agile Rails book''s chapter on ActionMailer a few times.
Seems pretty straight forward. Unfortunately I can''t get my
application to actually send mail.
I uploaded my application to the web server and tried to get a mail
message sent. Nothing happened. I looked in the log file and it says
Sent mail:
From: service@freedomkilts.com
To:
2006 Apr 26
3
catch all error for incorrect urls etc
Hi,
I am changing a very standard old school website to rails. When I make
the change to rails, all of the old urls will not be valid. If a
person has a bookmark to an old web page I would like them to be
directed to the front page of the new website www.domain.com. How do I
do this? Do I do something in routes.rb?
Thanks,
Peter
2006 Jan 26
8
switching to edge rails
Hi,
I want to start using has_many :through. I think that eventually I''ll
be removing all uses has_and_belongs_to_many from my project.
Here is my situation
I''m using SVN
I want to use edge rails
Reading the wiki about switching to edge rails[1], I can''t figure out
which combination of subsections I must perform.
Do I want edge rails to reside in the vendor
2006 Feb 09
2
_marker in dragdrop.js
Hi,
I''ve been confused about the purpose of _marker in dragdrop.js for
quite a while. It doesn''t really look like it does anything with
ghosting on or off. I removed the mark method and didn''t discover any
problems. Is all the mark business a relic from some past idea?
Thanks,
Peter
2006 Jan 23
4
an image that is a clickable link?
Hi,
How do I make an image that is a clickable link the rails way? Is
there a view helper for this?
Thanks,
Peter
2006 Mar 08
12
favorite FTP client of railers
Hi,
Which FTP client would fit in nicely with OS X and Textmate.
Thanks,
Peter
2006 Jun 08
3
RJS wierdness - Content div display js code
Hi,
I have a link_to_remote name ''Show notes'', which calls an action that
uses this RJS template:
page.replace "notes_remote", :partial => "notes/hide_notes_link"
page.insert_html :top, "notes_list", :template => "notes/list"
page.visual_effect :highlight, ''notes_list'', :duration => 3
Works great. The
2006 Jun 19
1
shared resources / polling / rjs
Hi,
In my web application, a users browser is divided into more than one
panel. Each panel is filled with html from an ajax response based on
what the user would like to view. Perhaps the details of a category
and it''s associated products in one panel and a list of customer
orders with the products of each order in another panel. Two panels
might be the same. Two users may be viewing the
2006 May 27
5
ActiveSupport JSON working?
Hi,
I am trying to convert a hash to JSON using ActiveSupports built in
.to_json. I am doing similar to the example below but are there
certain strings that could go in place of ''bar'' or ''rez'' that will
break the to_json method? I am using a very long string from rjs
output in place of ''bar''.
Perhaps .to_json is not ready yet?
Thanks,
Peter
2006 Mar 16
4
calling an actionview method from inside a model
Hi,
I would like my model instance to produce it''s own list of options for
a form select. This is from a product model that has_many variations
def alts_for_select(current_id)
the_map = variations.map{|v| [v.name, v.id]}
options_for_select(the_map, current_id)
end
the model cannot see the options_for_select method
I tried to use
2006 Jul 21
10
why validation on server side
hi,
i have noticed that the validations in RoR happen at server side
mostly what sites do is using javascript they validate user information
there...
whats the point of doing it at the server side
is it that loading of javascript file in a browser makes a response to
client slow
and validation at server side offsets that....?????
any sugeestions????
is it that i am missing something as
2006 Jul 10
2
cross controller functional tests?
Hi,
I have an online store and I would like to simulate a complete
shopping trip which involves several controllers? How can I write a
test that calls actions from different controllers in a particular
sequence? Something like the following which involves department,
product, cart_item, and cart controllers.
get department 5
check it has a link to product 4
get product 4
post cartitem/create
get
2006 Jan 15
2
scaffold suddenly pluralizing names
I haven''t updated rails today and all of a sudden scaffold is
pluralizing my names
ruby script/generate scaffold Admin::Category
produces
class Admin::CategoriesController < ApplicationController
Do I really want "CategoriesController" instead of "CategoryController"?
Thanks,
Peter