Displaying 20 results from an estimated 10000 matches similar to: "Including files from lib/"
2006 Jul 15
3
Why app/helpers are not app/view/helpers ?
So that we can write controller code inside helpers ? are we supposed
to do that ?
-Pratik
--
rm -rf / 2>/dev/null - http://null.in
"Things do not happen. Things are made to happen." - JFK
2006 Jul 11
3
update_attributes and save!
I notice that ActiveRecord::Base.update_attributes() calls save().
What if I want to get an exception if the save fails? Is there a way to
get the update_attributes() function plus the save! function?
Thanks,
Wes
--
Posted via http://www.ruby-forum.com/.
2005 Dec 28
8
Rails app lags after inactivity
Hi all. I have two Rails applications. Each is on its own VPS hosted by
Pipespring (excellent service btw).
My app runs lightning quick - AFTER the first load. If I visit my site after
a period of inactivity (i.e. no visitors to my site), it takes up to 10
seconds to load that first time. After that I can hop around with no
problems.
Has anyone run into this before? Ideas?
- Rabbit
2006 Jan 28
13
What''s the verb form of id?
Random question:
I''ve written a method for the String class that turns an arbitrary
line of text in to an identifier, e.g.:
"My, what a beautiful day!"
=> "my_what_a_beautiful_day"
"(anb*#NF(AMNV"
=> "anb_NF_AMNV"
We''ve got all these great names already like underscore, classify,
titleize and things like that. I''d
2006 Jan 26
1
Action variables not available in views with Ajax
The title pretty much describes my problem.
I have a standard Ajax call to an action the updates a portion of my view.
However, variables set inside the action are not available in my view. In
fact, NOTHING that happens in my action seems to affect my view. Calling
render :layout => false still gives me the flipping layout.
However, I know the Ajax call itself is working because I can do
2006 Jan 25
1
Routes working with subdirectories repeat subdirectory...
Hi all.
Views associated with admin controllers must always specify both :controller
and :action when using link_to.
Example:
<%= link_to ''Edit'', { :controller => ''/raid_manager'', :action =>
''edit_raid_template'', :id => raid_template.id } %>
The above is being called from within the Admin::RaidManagerController. The
2006 Jan 21
4
Ruby processes consuming 1,000 megs of swap space
Hi all. The subject pretty much says it.
I''m running on a VPS-style shared server at pipespring.com. I''ve got Typo
setup, and have been running it fine for about a month.
However, today I got an e-mail from my host saying they disabled Ruby (chmod
000) because it was using waaay too much swap space.
I haven''t changed anything with my server at all (Rails or otherwise)
2006 Jul 18
5
SQL query question
Hello,
I know it''s off-topic. But I''m sure you are using SQL and can help me ;)
I''ve a table CARS and a table KEYS and a LOCKS table.
CARS
id|name
1|audi
2|ford
3|mazda
4|porsche
...
KEYS
id|car_id|lock_id
1|1|1
2|2|1
3|2|2
4|3|1
5|3|2
6|4|1
7|4|2
8|4|3
...
LOCKS
id|name
1|main
2|spare
3|engine
...
A car can have many keys. Keys are for different locks.
How can I
2006 Jul 15
12
Safe way to destroy records
Hello,
how can I check if a destroy was successful?
Is the object only frozen if deleted or do I have to do an additional
find to see if there is a record left?
What happens if an after_destroy callback returns false? Is there always
a rollback?
Markus
2006 Aug 01
8
Dumb views?
Hello again! I''ve another "what would you do in this situation" question.
You''ve got 6 controllers, one named base. The other 5 controllers extend
base. Currently they share one layout.
Your layout displays navigation. However, there are two actions inside base
for which you do not want navigation displayed (index, new).
Do you...
a) Add logic to your layout telling
2006 Jul 09
3
Verify hash key in hash in params hash
Hi,
how can I use Rails ActionController::Verification#verify :params when
the hash key is in a hash?
E.g.: params[:form][:textfield] and I want to verify that :textfield is
a key in params[:form]
Thanks
Markus
2006 Jul 13
6
Content_for_layout
Question- if I have more then one view I wish to display in a layout , how
do I tell content_for_layout what to display and where ?
TIA
Stuart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060713/a2d0a8c8/attachment.html
2006 Jul 14
7
Using ActionView free style
ActionView is a very useful class, in its own right. But, calling it by
itself causes a weird crash, exiting Ruby, without even raising an
exception!
ruby script/runner "begin; av = ActionView::Base.new; av.render(:inline
=> ''Hi!''); rescue => e; puts e; end"
just crashes Ruby.
Same with render(:file => ''template.rhtml'')
Why is this?
2005 Nov 19
3
Permissions problem I don't understand
I am try to use rsync from my windows box (under cygwin) to back up "My
Documents" on to a debian server (known on my home network as roo.home)
running rsyncd from inetd where it is run as root.
my rsyncd.conf file sets the gid and uid to user backup.backup thusly:-
syslog facility = daemon
uid = backup
gid = backup
hosts allow = 192.168.0.0/24
hosts deny = 0.0.0.0/0
timeout = 600
2006 Aug 02
2
Behaviour that I don't understand
I am trying to set up rsync as a daemon under WindowsXP (professional) in
order to be able to backup this machine on to a linux server. I am
struggling with an issue I don't understand. I don't know whether it is an
Rsync issue or a Cygwin issue, so I am asking both mailing lists.
My WindowsXP machine has ip address 192.168.0.25 and name rabbit.home
My Linux machine has ip address
2006 Jul 10
18
Deleting join association of has_many :through
I''m trying to use has_many :through, since my join model deserves being
more than just an intersection table.
But when I try to break the association, the break only seems
"temporary":
Let''s say my two tables are Users and Colors, and the join model is
Favorites.
user = Users.find(1)
user.colors.length
>> 2
c = user.colors.first
>> #<Color:....>
2013 Jul 04
2
This isn't supposed to be difficult (how to nntp post to the Gmane Pan user group)
I realize this is (mostly) off topic, but I'm befuddled as to *how*
one can post to the Gmane Pan Users' group (gmane.comp.gnome.apps.pan.user)
using any nntp USENET client (e.g., Pan, on Centos).
I'm already subscribed (by having sent an email to pan-users at nongnu.org);
but I just want that USENET group to work like *this* USENET group, where
I can post using a server:port
2008 Feb 03
4
Extract vowels and consonants using Ruby Regex
Hello,
I am trying to build a regex to extract vowels and consonants from a
string. So far, I am able to extract the basic a-e-i-o-u sequence
using the following extension to the String class:
class String
def vowels
scan(/[aeiou]/i)
end
def consonants
scan(/[^aeiou]/i)
end
end
examples:
>> "Mary had a little lamb".vowels
=> aaaiea
>> "Mary had a
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
2006 Feb 11
16
Why does''nt rails pick up more metadata from a mysql schema?
Hi,
when I define a db column to be non-nullable or of length 20 or as
numeric, I would expect rails to validate that, but that doesn''t seem
to be the case.
Any idea why that is? The metadata is accessible, at least in the mysql case.
I am using rails 1.0 with mysql 5.
Cheers,
Mariano