Displaying 20 results from an estimated 1000 matches similar to: "Capistrano, ftp user and svn user are different"
2006 Mar 22
1
Capistrano - run command
Man, I can''t wait to get my hands on the capistrano book when it
comes out :-).
I have the following task in capistrano.rake (any task in deploy.rb
just does not want to be called)
=========
desc "Restarts the lighttpd server"
task :restart_server do
run "/users/home/jkopanas/bin/lighttpdctrl restart"
end
=========
When I run rake restart_server I get the
2006 Mar 20
4
Capistrano: cap show_tasks working but rake show_tasks not?
Does it make sense that if I type cap show_tasks it works but when I
type rake show_tasks I get:
rake aborted!
Don''t know how to build task ''show_tasks''
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake.rb:1287:in `[]''
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake.rb:300:in `[]''
2006 Mar 21
2
Capistrano: creating your own tasks
When I create a task within capistrano.rb I can call it using rake.
When I create a task and put it in deploy.rb I can call it. Neither
with or without the remote: namespace.
Anyone have any insight into why it does not work?
John Kopanas
2006 Feb 19
2
SwitchTower 1.0.0
SwitchTower is a utility that can execute commands in parallel on
multiple servers. It allows you to define tasks, which can include
commands that are executed on the servers. You can also define roles
for your servers, and then specify that certain tasks apply only to
certain roles.
Manual: http://manuals.rubyonrails.org/read/book/17
Project:
2006 Mar 21
2
Migration ~ Create
In one of my migration files I have the following:
===========
def self.up
User.create :name => ''John Kopanas'', :email =>
''john@kopanas.com'', :password => ''test''
end
===========
When I run it I get the following error:
===========
undefined method `create'' for
2008 Nov 19
3
Rails.cache and problem with model id?
I have the following:
MODEL:
def self.get_tag_cloud
Rails.cache.fetch(''fetish_tag_cloud'', :expires_in => 1.hour) do
find(:all, :conditions => [ "approved_for_tag_cloud = true"], :order
=> "LTRIM(name)")
end
end
CONTROLLER:
def index
@fetishes = Fetish.get_tag_cloud
end
VIEW:
....
<% @fetishes.each do |fetish| -%>
2005 Mar 11
4
actionmailer settings
A couple questions:
1) How does rails no if you are in your test, dev or production
environment?
2) Does anyone have an actionMailer server settings that will work on
your standard local machine? I will use the one provided for my
textdrive account but for testing on my machine I am getting connection
refused.
Thanks.
Your Friend,
Jonathan Kopanas
http://www.kopanas.com
2006 Feb 17
2
acts_as_versioned and acts_as_taggable on same model?
I am trying to use acts_as_versioned and acts_as_taggable (plugin) on
the exact same model. Has anyone successfuly done this? I think
what I need to do is make model_versions acts_as_taggable instead of
my main model. Anyone have any other suggestions or any suggestions
how to do this?
Your Friend,
John Kopanas
http://www.kopanas.com
2006 Feb 13
3
Getting Rid of Error Divs around fields that have errors
Is there a way to get rid of the divs around an error field. These
divs are causing me headaches. Any suggestions :-)?
John Kopanas
http://www.kopanas.com
=====================================================================
http://www.soen.info - source of the freshest software engineering
information on the net
http://cusec.soen.info - software engineering conference
2006 Feb 12
5
Passing Multiple Values In URL
Been a while since I programmed in Ruby and Rails and some of the
basic concepts I just loose so quickly. This one I can''t find any
examples of.
I want to pass two pieces of information in my URL. The :id plus I
want to pass my user_id. How do I pass it using the link_to?
Stupid question I know... but I can''t find the answer.
John Kopanas
http://www.kopanas.com
2006 Feb 13
2
Overriding the error_messages_for method
If I wanted to override the error_messages_for method where within
the rails structure would I put it? Which file?
Thanks :-)
John Kopanas
http://www.kopanas.com
=====================================================================
http://www.soen.info - source of the freshest software engineering
information on the net
http://cusec.soen.info - software engineering conference
2006 Feb 14
6
Creating a String of Random Characters and Numbers
I want to create a random string of length n that is made up of
characters and integers. Is there a function in rails or ruby that
allows me to do this?
Thank you my friend :-).
John Kopanas
http://www.kopanas.com
=====================================================================
http://www.soen.info - source of the freshest software engineering
information on the net
2006 Jun 09
2
Creating An Extra Association Between Two Tables
Good Friday Everyone :-).
These are my models:
Problem -> has_and_belongs_to_many :tags
Tag -> has_and_belongs_to_many :problems
Now if a tag does not exist and I create it and associate it to the
problem it works
self.tags << Tag.create(:name => tag)
But if I have the tag already in the DB and just want to link it to
another problem it does not really like me. I do it
2008 Dec 05
1
Question About Rails.cache and find method.
The DB load on my site is getting really high so it is time for me to
cache common queries that are being called 1000s of times an hour
where the results are not changing.
So for instance on my city model I do the following:
def self.fetch(id)
Rails.cache.fetch("city_#{id}") { City.find(id) }
end
def after_save; Rails.cache.delete("city_#{self.id}"); end;
def
2006 Feb 11
2
Migrations and Unintialized Constants Error
I am running into a problem with two of my tables and the
"uninitialized constant" error when using migration.
I get the "uninitialized constant Note" when running the following
code in my migration file:
create_table :notes do |t|
t.column :id, :integer
t.column :noteshare_id, :integer
t.column :title, :string
t.column :covered, :string
2006 Jun 10
3
Weird Problem With Active Record
Is it me or is my model getting the created_at from the wrong model!
I have a HABTM relationship between Problems and Tags. In one of my
controller I do the following:
def view
@tag = Tag.find_by_name @params[:id]
end
In my view I do this:
<% @tag.problems.each do |problem| %>
...
<%= problem.created_at %>
...
<% end %>
Now, how come the created_at
2006 Feb 14
8
Best Practices For back/cancel/return button
Are there any best practices for implementing a back/cancel/return
button... even when the page you want to return people too is 2 pages
back (when people submit form and then want to return)?
Thanks :-)
Your Friend,
John Kopanas
http://www.kopanas.com
=====================================================================
http://www.soen.info - source of the freshest software engineering
2006 Feb 15
8
[OT] I user CocoaMySQL... anyone have any other preferences for MacOS X?
Looking for a quality alternative... if there is one :-).
John Kopanas
http://www.kopanas.com
=====================================================================
http://www.soen.info - source of the freshest software engineering
information on the net
http://cusec.soen.info - software engineering conference
2006 May 26
2
link_to and fragment identifiers
Fragment identifiers, it took me 30 minutes just to figure out what
they are called.
I would like to be able to create url that looks like this:
post/view/id#comments
How do I do that with a link_to function?
link_to "Comments", :controller => "post", :action => "view", :id =>
post.id ???
Thanks guys! :-)
John Kopanas
http://www.kopanas.com
2006 Feb 12
2
Using Random Longer Non-Sequential IDs
Instead of using sequential integers for IDs for my objects I was
wondering if I could easily make it so that my IDs where longer auto-
generated random strings/integers.
So instead of:
http://www.mydomain.com/user/view/1
Would be:
http://www.mydomain.com/user/view/d81096b87a7c5565f
On top of that... is there big benefits for security reasons to use
non-sequential numbers? Is it worth