Displaying 20 results from an estimated 1200 matches similar to: "Where is the send() function?"
2006 Jun 08
5
Field names in validators
Hi!
Is there a (simple) way to use alternative field names in validation
messages? For example, if I have a validator like this one:
validates_presence_of :email
how can I make it print a message like "E-Mail Address can''t be blank"
instead of "Email can''t be blank"? I can override the "can''t be blank"
part by using the :message
2006 Jul 12
3
How to get the current URL?
Hi,
how can I get the current URL withing a controller? There seems to be no
appropriate method in ActionController::Base.
I''m creating a site, which requires a login for some pages. I''m using
before_filter for authentication. My idea was to store the currect URL
in a session before redirecting to the login page and then redirect to
this URL after successful authenfication.
2006 Mar 12
2
Strange error: undefined method `rewrite''
Hi,
when I generate a new rails project with a simple scaffolded controller,
I get a strange error message, whenever it tries to call the url_for
method, for example:
,----
| undefined method `rewrite'' for #<Url:0xb7675e64>
|
| Extracted source (around line #7):
|
| 4: </p>
| 5: <% end %>
| 6:
| 7: <%= link_to ''Edit'', :action =>
2006 Apr 15
7
New to rails - scaffold command , how to get related items?
Ahoy,
I was able to follow the tutorials and build a simple to-do list program
with Items and Categories and have the related tables link up w/ the
default "scaffold :Items" command plus custom defenitions.
Then I erased all of that and tried rebuilding the program using the
ruby script/generate scaffold Item (and category) command.
Now the templates look like
"
<% for
2011 Mar 22
2
Problems with SQLite3
Hi!
I''ve got a very strange problem. Suddenly the SQLite3 Backend stopped
working.
Example 1:
> rake db:rollback
== CreateProducts: reverting
=================================================
-- drop_table(:products)
rake aborted!
An error has occurred, this and all later migrations canceled:
SQLite3::SQLException: near "CASCADE": syntax error: DROP TABLE
2006 Apr 21
9
Capistrano, OS X
If you installed your copy of ruby via DarwinPorts, the hashbang lines
at the top of your dispatch.* scripts says "#!/opt/local/bin/ruby". This
is a problem, if you''re deployin via Capistrano to a host with a
different path to ruby (which would be practially all of them:-)
Here''s a fix. Add this "fix_hashbangs.rb" script to your script
directory.
2006 Feb 15
5
dispatch.cgi error affecting specific browsers
I have a rails app that is accessed through Apache 2 (just using cgi
now; will add fastcgi later when everything is working).
The app works fine with some os/browser combos at my work site:
windows/IE
Mac/safari
Mac/firefox
Linux/firefox
But it fails on windows/firefox and my colleague''s (at a different site)
mac/safari (we are running the same os version and version of safari)
The
2006 Mar 27
3
Enumerable?
Hi,
Can anyone please point me to some docs on Enumerable. I can''t seem to find
anything on how to use it.
Thanx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060327/0825d5e8/attachment-0001.html
2006 Jan 30
1
how to get column_for_attribute?
Hi all,
In the code below I don''t understand:
1. Why I have to prepend overriden method content_columns with "self."
to get it working?
2. Why column_for_attribute method is not working (no such method?) even
if SomeTable is subclass of ActiveRecord::Base which have public
column_for_attribute method?
> class SomeTable < ActiveRecord::Base
>
> def
2006 Apr 27
2
"for column in..." not picking up _id columns
My code executes fully:
<% for column in ModelName.content_columns %>
<th><%= column.human_name %></th>
<% end %>
but it does not pick up any columns in my model''s table that end in
"_id".
Is this by design?
Is there a helper method that will reference the related tables? Or
will I need to code the column titles and detail records by
2000 Jul 05
0
smbclient -p <port> worked in samba 1.19.18p10, not in samba 2.x
It appears that "smbclient -p <portnumber>" doesn't work as advertised in
Samba 2.x? On both Linux 6.2 and Solaris 2.6, independent of firewalls and
the like, it works with old Samba (e.g. 1.9.18p10) , but not with new Samba
(e.g. 2.0.7). The new version seems to *IGNORE* the port specification and
attempt to connect to port 139.
Here's the result when I try to send a
2006 Aug 07
8
Syntax Problem
In an *.rhtml, why do I need to add <% for product in @products %> in
order that I may call an <img class="list-image" src="<%=
product.img_url %>"/>. Is there not another way to skip the "for
product" line? I really dont want to include it. I tried @products =
product but it does not work. Can anyone help shed light on this matter?
--
Posted via
2006 Aug 18
3
Understanding MVC - view customization after using scaffolds
All,
I have ordered AWDWR and am anxiously awaiting its arrival. In the
meantime I still am playing with ROR using radrails. I have a few
questions ...
I create a table named customers with the following details:
Field Type Null Key Default Extra
id int(11) NO PRI auto_increment
customer_name varchar(50) NO
inbound_retention int(11) NO
outbound_retention int(11) NO
unix_admin_email
2005 Dec 30
3
Too many columns for list.rhtml to display on one page
I''ve gone once through the Agile book and am now attempting my own rails
app. I''ve created a table named ''volunteers'' with over 15 columns. The
problem is the default list.rhtml that is created with the scaffold,
shows all the columns. I only want to show 4 of them with the list
view.
Where would I start to only return a handfull of columns to the
2000 Jul 16
1
"smbclient -p <port>" appears to be broken in Samba 2.x
I posted this problem as a question to this list a while ago and got no
reply. I submitted it as a bug, but found that "samba-bugs@samba.org",
no longer accepts bug reports, even though the web page says to send them
to that address.
Wondering if the option had been intentionally discontinuted without
updating the man page, I made a quick check of the source and found that
the "-p
2006 Jul 06
3
Calling Method
Is there a way to call a method if I only have a string that contains
the method name.
For example:
@methods = [''method1'', ''method2'', ''method3'']
@step = 1
# I want to call method2 which has a definition in this class
--
Posted via http://www.ruby-forum.com/.
2006 Apr 06
2
making an integer from a float
Does anybody know how to turn a floating-point number (i.e. 60.345) into
an integer by cutting off or rounding the decimal portion? Either
method, or both, would be quite welcome. Thanks! This forum rocks!
--
Posted via http://www.ruby-forum.com/.
2006 Mar 14
4
What does the send() method do on a model object?
All,
I did a scaffold for a model and I ended up with this code in
list.rhtml:
<% for column in TargetList.content_columns %>
<td><%=h target_list.send(column.name) %></td>
<% end %>
Where is the "send" method and what does it do?
I can''t find it on ActiveRecord::Base? I assume that it returns a
value based on the column id but I
2006 Mar 22
3
Something wrong with content_columns
I have a database with a couple of tables. One table called spares has
foreign keys in another called equipment. When I create a new record,
it is added to the spares table however the list action does not show
all the columns in the table. It only shows those columns that are not
foreign keys. I am using the default action generated by scaffold for
list.
Why is that so? Do i need to re-write my
2008 Mar 15
9
Spaces in Ruby on Rails and how to avoid them!
Hi,
I just started learning ruby on rails and I am having hard time with
white spacing!
Here is the piece of code that will not work:
validates_format_of
:image_url,
:with => %r{\.(gif|jpg|png)$}i,
:message => "must be a URL for a GIF, JPG or PNG image"
and here is the piece of code that will work:
validates_format_of :image_url,
:with => %r{\.(gif|jpg|png)$}i,
:message