Displaying 20 results from an estimated 5000 matches similar to: "Link helpers and AJAX callbacks"
2006 Dec 11
2
Custom Validator
I want to add a custom validator in one of Model. For example Rails has
inbuilt validation methods like validates_uniqueness_of,
validates_presence_of . What I need is a similar kind of method
(example: validates_line_items), that can run my custom code while
saving, updating the record and can add custom error messages to the
record. Please help me by suggesting how i can do this.
--
Posted via
2006 Apr 08
5
Creating sub actions
Hi,
So finally I have also decided to roll my engines on Rails. But I am
kind of stuck in a situation. I understand that for every model there is
a controller class. This controller class has cirtain set of methods
where each method defines cirtain action to be performed. And each of
this action renders cirtain UI.
[The background]
Now let say I have a object "Car". Apart from
2006 Jun 28
1
Iconv library error
I am trying to run a web application. I downloaded the web app package
and then tried to run the Webrick server. I got this error:
----------------------
C:\Documents and Settings\Dipesh\My
Documents\RubyOnRailsProjects\feedmarker>rub
y script/server
=> Booting WEBrick...
The Iconv library does not appear to be installed properly. FeedTools
cannot fu
nction properly without it.
2008 Mar 13
2
Google Calendar
Anyone aware of good calendar library in Ruby? I need to design a
calendar similar to Google calendar. The idea is to have ability to add
recurring or even infinite events as it is possible in Google calendar.
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on
2006 Jul 04
1
Select Box problem in the controler with Ajax
Hi,
I have a selectbox that updates a given span area when a user selects a
value. The selectbox has the option :include_blank => true. The
controler will fetch the ID of the selected option in the combo box and
sends the description of the item with the same ID.
The problem is that the user is able to select the empty option, and the
controler will not be able to fecth the ID. This
2006 Mar 26
4
Updating query results in real time with AJAX
I have the following view template:
<%= form_remote_tag :update => "new_item",
:url => {:action => ''create''},
:before => %(Element.show(''spinner'')),
:success => %(Element.hide(''spinner'')) %>
<div id="new_item">
</div>
2005 May 17
5
Strings, Variables and GetText
Hi,
I''m starting to use GetText and have this code:
render_text %(<script language="JavaScript" type="text/javascript">
parent.mainframe.onUpdateNew("Gallery <b>#{@media.name}</b> was
successfully created.",
"#{@media.name}","#{String(@media.id)}","#{@media.media_type}");
</script>)
I need to convert
2005 Dec 26
3
probably a very dumb question
why does <%= render_text "hey ya" %>
cause ''undefined method `render_text'' for
#<#<Class:0x3851120>:0x3851000>''
can i use render text in a template?
--
Posted via http://www.ruby-forum.com/.
2007 May 21
4
Just upgraded to 1.0.0, should render_text isn''t working for me
I finally got around to upgrading from 0.8.2 (!!). I had a spec which
looked like
specify "should render abc123" do
controller.should_render :text => "abc123"
get :key
end
With 1.0.0, the new spec is
it "should render abc123" do
get :key
response.should render_text("abc123")
end
However it doesn''t work, giving me the error:
undefined
2006 Jan 07
2
can store array or hash in cookies?
Hi
According to rdoc: value - the cookie''s value or list of values (as an
array).
So, I can use arrays, briliant.
But.... It does not work (at least on webrick)
I wrote a controller:
def check_cookies_first
cookies[:chef] =
{:value => ["first", "second"], :expires => Time.local
(2020)}
render_text ":)"
end
def
2006 Oct 14
2
sending parameters with link_to_remote Ajax Request
In a panel, I have an hidden input field which is modified by a
javascript function (from calendar)
how can I sent the value of this input field in my link_to_remote call ?
presently I just send back one parameter (an id) but I need both...
<input type="hidden" name="booking[start_at]" id="f_date_s"
value="booking[start_at]" />
...
<%=
2007 Sep 29
2
REXML - XML query only returning one (last) result
I''m really new to Ruby on Rails, and I''m trying to read an XML file
with REXML. No matter what I try, I am only getting the last result
returned from my query. I should be getting 365 results. Here is the
code:
include REXML
require ''rexml/document''
require ''rexml/xpath''
class MakeFootprintController < ApplicationController
def index
2007 Oct 26
1
some xen issues
Hi ,
We are using Xen 4.0 version.
These are the problems we are facing:
1) Centos-5 installed successfully from other installation media, Video card
is detected but
mouse is not working.
2) Centos-5 installed successfully from inbuilt template,but Video card is
not been detected.
3) Debian 4.0 installed from other installation media, GUI is working but
mouse is not working.
4) Debian 4.0
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 Aug 17
0
AJAX - Having Multiple SELECT (Drop Down), and dependency
Hi
I have three drop downs (State, City, Locality) and would like to
populate
City based on State selection and Locality based on City selection.
I have observers on two fields (State, and City). The observer_field on
state
works fine and it populates city based on state selection. But the
observer
on city doesn''t populate Locality. Now sure whats wrong with my code.
here is the
2005 Nov 18
2
help with User.find() and rendering text
Hi all,
I''m trying to do something for a project. Herez what im trying to do.
The user name gets passes from the view to the controller.
On line2: The user name gets displayed.
On line 3: (If this command works the way I think it works, the sad part
is I always get it wrong) anyways, The entry in the data base with the
given user name gets searched and the user info gets stored in
2006 Aug 16
8
Multiple (AJAX) Observers on the Same Field and MSIE
I have been using multiple observers, i.e., observe_field(), on the same
input field and relying on them to execute in the same order that they
appear in the page. This has been working fine in FireFox, but it does
not seem to work in MSIE; the requests come in and are processed in a
different order. Now, I''ve always been a little hesitant about using
this technique, but it always
2006 Apr 03
9
Problem with Windows not finding methods
I am running (testing) a noob-tube for myself as follows:
Windows XP SP2
lighty
ruby 1.8.x
rails 1.1
scgi
I have everything working fairly well, but with one minor exception:
the actions that I have defined as follows are not found.
class MytestController < ApplicationController
def index
render_text "Hello Nurse!"
end
def dilbert
render_text "Dilbert
2006 Feb 12
3
.empty? Method
I am using:
if @post.empty?
render_text "Post does not exist."
end
But it gives me this error:
NoMethodError in Posts#view
undefined method `empty?'' for #<Posts:0x39598d0>
However, if the method list empty? apears and stuff so I am confused.
--
Posted via http://www.ruby-forum.com/.
2006 Mar 05
3
Trying to connect tables .....
I am trying to ''connect'' two tables AdHour and Ad in the method below.
However, the line with the asterisks is causing the following error:
"You have a nil object when you didn''t expect it!
The error occured while evaluating nil.user_id"
I''ve included the model for both AdHour and Ad.
Why doesn''t the script like how I am connecting the