Displaying 20 results from an estimated 70000 matches similar to: "detect ip country of origin"
2007 Mar 16
7
how to send mp3 inline?
hey all,
I''m trying to do a:
send_file @file, :type => ''audio/mp3'', :disposition => ''inline'' ,:stream=>true
I tried with all browsers and it always asks me to download the file
or open it with a player. Is there a way to make it open in the
embeded player (QT,Windows media player,Mplayer etc)? Only with
konqueror if I open in new tab then I
2006 Dec 16
5
trying to add another app
hey all,
I have an app working great with apache2 and mongrel_cluster.
However, I''m trying to run another application and now when I go to
app1.comit falls to
app2.com and the opposite. That''s probably because I messed up somewhere
with the cluster.
this is the content of my conf.d/app1.proxy_cluster.conf:
<Proxy balancer://mongrel_cluster>
BalancerMember
2006 Nov 13
1
Service Temporarily Unavailable when using apache
hey all,
I''m trying to do a mongrel_cluster+apache2 config.
this is my testapp.conf:
<VirtualHost *:80>
Include /etc/apache2/conf.d/testapp.common
# ErrorLog logs/testapp_errors_log
# CustomLog logs/testapp_log combined
</VirtualHost>
this is my testapp.common:
ServerName myapp.com
DocumentRoot /home/patcito/testapp/public/
<Directory
2006 Oct 25
4
need help on special HABTM relation
hey all,
I have three tables like this:
forum (id,title)
usergroup(id,title)
forum_perms(usergroup_id,forum_id,read,write,post)
is there a way to deal with that kind of relation with rails such as by
using has_and_belongs_to_many kind of stuff?
thanx in advance
Pat
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
2006 Nov 13
1
rails+apache2+mongrel_cluster
hey all,
I managed to configure a mongrel+apache2 but now I would like to do a
mongrel_cluster. For now I have a sites-available/myapp but when it
comes to mongrel_cluster I need to set up myapp.common,
myapp.proxy_cluster.conf and
myapp.proxy_frontend.conf and I couldn''t find a tutorial that explain
where should those file go. is it in conf.d or sites-available/ or
else?
thanx in
2006 May 14
4
searching on foreing keys
Hey all,
I''m using a simple search function. It''s working
great except for foreign keys.
I have one table pets (id,name,owner_id)
and another table people(id,name)
owner_id being a foreign key of pet pointing to people name.
here it is on the pet controller:
@paginator, @pets= paginate(:pets, :conditions =>["name OR owner_id
like
2007 Jun 21
2
does activeresource only work with edge?
hey all,
I''ve just installed the activeresource gem and it wasn''t working, so I
did gem update rails and it worked. But now I have rails-1.2.3.6906
and I think this is edge right? Is there a way to work on regular
rails 1.2.3 with activeresource?
thanx in advance
Pat
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to
2006 Aug 17
1
2 newbie question
Hey all,
I have 2 newbie questions,
1st question:
<%= collection_select (:region, :id, @regionall, :id,
:title,options={:prompt=>"- Select cat -"}) %>
Ignores the :prompt part while options={:include_blank => true} works.
Any idea what I?m doing work with :prompt ?
2nd question:
How can make my collection_selected to display it''s third key by default?
I know it has
2006 Nov 04
1
search function
Hey all,
I''m writing a search function for my page but I get stuck at the form
part. When I press submit all the params are nil.
here is my list.rhtml:
<%= start_form_tag :controller=>''ads'', :action => ''search'' %>
<%= render :controller=>''cats'',:partial => ''/cats/search'' %>
<p> <%=
2007 Jun 06
4
globalize+acts_as_ferret
Hey all,
I''m using acts_as_ferret and globalize. I stumbled upon that post on google:
http://osdir.com/ml/lang.ruby.ferret.general/2007-01/msg00068.html
does anybody know if it''s included in the latest a_a_f or if it''s
planed to be? I can''t seem to find anything about it.
thanx in advance
Pat
2006 Dec 07
2
need to transfer data from old php like db to rails style db
hey all,
I have two tables like that from an old php project:
artists(id,name)
albums(id,artist_id,album_name)
and I need to transfer the data of this database to three tables that
look like this:
artists(id,name)
albums(id,name)
artists_albums(album_id,artist_id)
any idea what''s the fastest query to do this?
thanx in advance
Pat
--~--~---------~--~----~------------~-------~--~----~
2006 May 13
1
need help for my link_to
I have a model Document that shares the same primary id with another
model Upload, I would like to put a link on _list.rhtml of my
document to edit the upload of the same id.
I tried something like <%= link_to ''Edit'', {:controller => upload,
:action => ''edit'', :id => document} %> but obviously that''s wrong. Any
idea how to make it right?
2007 Mar 26
1
how to close a popup?
hey all,
I open a popup from a firefox extension with window.open(myurl).
The content of the popup is a regular form with a text_field to fill.
Is there a way to automatically close the popup after the user click
the form''s submit button?
thanx in advance
Pat
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
2007 Aug 15
2
need help on writing a plugin
Hey all,
I''ve just "script/generate plugin my_plugin" and I would like to
"overload" one of my view. Say I have app/views/sessions/new.html.erb
and I would like to rewrite that file without touching it using the
plugin. Any idea how to do this? I would also like to do the same
thing with models and controllers of my application. I couldn''t find a
tutorial
2007 May 23
2
issues with searching custom fields
Hey all,
I''m using acts_as_ferret this way:
class Job < ActiveRecord::Base
acts_as_ferret :fields => [:title, :workers_name]
def workers_name
return self.workers.inject("") {|names,b| names + " " + b.first_name}.to_s
end
end
But when I do Job.find_by_contents("workers_name:patrick")
I get nil.
Yet when I do:
j=Job.find :first
j.workers_name
I do
2007 Nov 09
26
RSpec on Rails 2.0
I have a project on edge rails that I''m trying to convert from Test:Unit
to rspec. I have the rspec gem version 2338, the rspec and
rsepc_on_rails version 2831 in vendor/plugins, and rails version 8117 in
vendor/rails.
I''ve been able to get a few specs passing, have gotten the specs running
from autotest, and am able to do "rake spec:doc" and get the basic
command
2006 Jul 17
6
3 newbie questions
hey all,
I have 3 tables like this:
Images (id,name)
Tags (id,name)
ImagesTags(imageid,tagid)
in my image model I do a "has_and_belongs_to_many :tags" but to make
it work I need to rename ImagesTags(imageid,tagid) to
Images_Tags(image_id,tag_id). My question is that given that I can''t
rename the table, is there any way to make it work with the original
names?
Second question:
2007 May 25
1
how to update index with acts_as_ferret?
Hey all,
I have movie has_many :medias and media belongs_to :media
this is how my movie class looks like:
class Movie < ActiveRecord::Base
has_many :medias
acts_as_ferret :fields => [:title,:medias_name]
def medias_name
return self.medias.inject("") {|name,m| name + " " + m.name}
end
end
when I do Movie.find_by_contents("title:bob") it does return a movie
2007 Jan 04
1
rmagick working in console but not in my app
hey all,
When I do this in script/console I get:
>> require ''RMagick''
=> true
>> include Magick
=> Object
>> f = Image.new(100,100) { self.background_color = "red" }
=> 100x100 DirectClass 16-bit
>> f.crop_resized(50,50)
=> 50x50 DirectClass 16-bit
But in my application I keep getting the same error as if rmagick was
not
2006 May 13
1
how to close the window on def update?
hey all,
I have my usual update function like this:
def update
@document = Document.find(params[:id])
if @document.update_attributes(params[:document])
flash[:notice] = ''Document was successfully updated.''
redirect_to :action => ''show''
else
render :action => ''edit''
end
end
I would like to change: