Tony Augustine wrote:
> see i defined one method called campaign in the model and through a
> url i am tryong to pass two parameters like user_id and campaign_id
> into a method called mail_open_count. how i can pass 2 that method.
>
>
> def campaign(campaign)
>@campaign_id= "[#{cam
the paperclip works on ubuntu but on windows it gives an some error.
the error is
" There were problems with the following fields:
Avatar C:/DOCUME~1/ozone/LOCALS~1/Temp/Water lilies,2700,0.jpg is not
recognized by the 'identify' command.
Avatar C:/DOCUME~1/ozone/LOCALS~1/Temp/Water lilies,2700,0
see i defined one method called campaign in the model and through a
url i am tryong to pass two parameters like user_id and campaign_id
into a method called mail_open_count. how i can pass 2 that method.
def campaign(campaign)
@campaign_id= "[#{campaign.email_campaign_content.campaig
Sharagoz wrote:
> In the first one, the child is saved right away.
> In the second, the child is not saved until the parent is saved
>
> You may find this usefull:
> http://blog.mrbrdo.net/2009/10/27/ruby-on-rails-new-vs-create-vs-build/
Thanks Sharagoz. I got some idea about this.
--
Posted vi
Wanderwelten wrote:
> Hey everyone,
>
> i can't build AR-Queries with relationships between tables. Here's a
> short sample:
>
> class Customer < ActiveRecord::Base
> has_many :projects
> end
> class Project < ActiveRecord::Base
> belongs_to :customer
> end
> When I execute the following Code
Now i am working on an cart application, when i add an item to cart(in the
domain of http://www.example1.com), and then checkout(in the domain of
https://www.example2.com), i still want to get the item from the cart. I
used the plugin of ssl requirement, and i append the host and session_id
into
On Sun, Apr 25, 2010 at 5:20 PM, Conrad Taylor wrote:
> Mohammed, you can write the above as follows:
> @property.destroy if IsAuthorized?(@property.user_id)
Well, you could, *if* IsAuthorized? -- which idiomatically should
be is_authorized? -- returned a boolean value :-)
>> def IsAuthorized?
Thank you Colin and Marnen for your repsonses.
Marnen Laibow-Koser wrote:
> Colin Law wrote:
>> On 25 April 2010 00:45, Mike P. wrote:
>>>...
>>> I think if people could just get over the "don't optimize too early"
>>> mantra, and realize that this can't possibly be best move for everyone,
>>> a
On Sun, Apr 25, 2010 at 5:16 PM, Mohammed Alenazi wrote:
> Hi
>
> I have this code
> def destroy
>@property = Property.find(params[:id])
> IsAuthorized?(@property.user_id)
>@property.destroy
>
>
Mohammed, you can write the above as follows:
@property.destroy if IsAuthorized?(@property
Hi
I have this code
def destroy
@property = Property.find(params[:id])
IsAuthorized?(@property.user_id)
@property.destroy
respond_to do |format|
format.html { redirect_to(properties_url) }
format.xml { head :ok }
end
end
def IsAuthorized?(id)
if current_
Hi Paul,
I'm running a test server in production environment with nginx as
front-end, ruby-1.9.1-p378 and one mongrel in the backend.
The script I'm currently using to start the application is as
following:
#!/bin/sh
export RAILS_ENV=production
# kill old server if running
if [ -f /home/csb/app
Has anybody succeed in getting Rails 3 to work in production? I am
trying with Apache 2.2 and Passenger 2.2.12 but no luck. If you have
got Rails three to work in production on any server with any set up
could you please post the details (howto?) or a link to where such
information can be found.
A
On 26 April 2010 02:56, dmack wrote:
> Just curious if you tried removing the "config.ru" file from your
> rails application's root directory? It seems to be a different error
> than me but I thought I would throw it out there just in case it
> helps.
>
> My environment is:
>
> FreeBSD 6.4
> Ru
I've always used the gem, and I've never once had to run a2enmod, but
I suppose it depends on how you do it.
If you just add it to the bottom of /etc/apache2/apache2.conf, then
you don't have to do that. Otherwise, yes, you'd have to use a2enmod.
Either way, it's simple to do. Yes, a2ensite does
Hey everyone,
i can't build AR-Queries with relationships between tables. Here's a
short sample:
class Customer < ActiveRecord::Base
has_many :projects
end
class Project < ActiveRecord::Base
belongs_to :customer
end
When I execute the following Code in my Controller: @customers =
Customer.all
class Customer < ActiveRecord::Base
has_many :projects
end
class Project < ActiveRecord::Base
has_many :works
belongs_to :customer
end
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to rubyonrail
On 25 April 2010 18:44, Hassan Schroeder wrote:
> On Sun, Apr 25, 2010 at 9:40 AM, Colin Law wrote:
>
>> I believe he has been trying to do that, but is that what he needs to
>> do? Can he not just set the condition variable in the controller
>> action? With a parameter on the link calling the
Just wondering if anyone can confirm this for me.
Updating an existing app from 2.3.5 (without Bundler) to 3.0.0b3 (with
Bundler) it appears that the "rails/init.rb" file is no longer
evaluated for vendored gems any more. Or for non-vendored ones,
either.
No big deal. I can explicitly call the se
> Comment.find :all, :joins => :story, :conditions => {:stories =>
> {:id => 1}}, :order => "comments.created_at DESC"
>
> Hope that helps.
Thx a lot @Michael!!
You saved the day!
LP
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Go
Please disregard my previous message. I forgot textilize was kicking in.
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To
If anyone understands:
def some_method
"
whatever('element');
"
end
=>
whatever(‘element’)
Any idea what could create that strange behavior?
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby
o
On Apr 25, 6:35 pm, Scott Kulik wrote:
> Frederick Cheung wrote:
> > On Apr 25, 1:57 am, Scott Kulik wrote:
> >> updating the database when a users has problems with their private
> >> messages page.
>
> >> I'm wondering if someone knows a good way I could scan the the pm's
> >> table and delet
On Sun, Apr 25, 2010 at 9:40 AM, Colin Law wrote:
> I believe he has been trying to do that, but is that what he needs to
> do? Can he not just set the condition variable in the controller
> action? With a parameter on the link calling the action if necessary.
Not according to the examples pro
Frederick Cheung wrote:
> On Apr 25, 1:57�am, Scott Kulik wrote:
>> updating the database when a users has problems with their private
>> messages page.
>>
>> I'm wondering if someone knows a good way I could scan the the pm's
>> table and delete messages that no longer have a user for sent_to or
Actually I was wrong, I am thinking the thing the wrong way.
I have a model Defi which as many Participant.
I would like to create a link_to to add a Participant to a Defi.
How do I do this? Is it in the Defi controller or the Participant
controller?
Greg
--
Posted via http://www.ruby-forum.com
Thanks guys
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to
rubyonrails-talk
On 25 April 2010 17:07, Hassan Schroeder wrote:
> On Sun, Apr 25, 2010 at 8:53 AM, Colin Law wrote:
>
>> Or copy it into an @ variable in the controller action to make it
>> available in the rendered view. But I believe for the OP's problem he
>> does not require to use params (or persistence) a
... or at least
link_to "Ne pluys participer", participant_path(current_user), :method =>
:delete ..
On Sun, Apr 25, 2010 at 11:10 PM, Greg Ma wrote:
> Hi,
> I'm having problem with a link_to delete action. I don't understant what
> i'm doing is wrong.
>
> Here is my code:
> <% participant
On Apr 25, 4:20 pm, Olivier Lance wrote:
> Thanks for the quick reply :)
>
> > If you give filter_parameter_logging a block it will yield parameter
> > names/values to that block and you can make the decision to filter on
> > a case by case basis. Is that enough for you ?
>
> I've tried this, bu
Hi Greg,
You might want to put your variable assignment (participant) in your
controller instead of your view.
In your link_to, 'participant' has no meaning. Do you have RESTful routing
setup? Perhaps you meant to write:
<%= link_to "Ne pluys participer", participant_path(@participant), :method
Hi,
I'm having problem with a link_to delete action. I don't understant what
i'm doing is wrong.
Here is my code:
<% participant = item.participants(:user_id => current_user.id).first
%>
<%= link_to "Ne plus participer", participant , :method => :delete,
:confirm => "Etes vous sur de ne plus v
On Sun, Apr 25, 2010 at 8:53 AM, Colin Law wrote:
> Or copy it into an @ variable in the controller action to make it
> available in the rendered view. But I believe for the OP's problem he
> does not require to use params (or persistence) at all. See my
> previous post.
My impression is that
i've now added validation failure messages like this...
def self.find_nil_and_save(name)
resorts = Resort.find(:all, :conditions => {name => nil})
resorts.each do |resort|
puts resort.name + " #{name} is empty. Enter a value..."
new_value = gets.chomp
puts resort.name
On 25 April 2010 16:45, Hassan Schroeder wrote:
> On Sun, Apr 25, 2010 at 8:38 AM, RichardOnRails
> wrote:
>> I think I see the cause of lack of communication between params in
>
>> Am I all wet about this?
>
> Yes. I think you are totally missing how the Web works :-)
>
> The params hash represe
After reinstalling PostgreSQL, using initdb to set the template
encoding to UTF8
rake db:create
in fact creates a database.
Now, time to learn some rails.
On Apr 24, 9:43 am, cootcraig wrote:
> Actually my development server is FreeBSD. My workstation is Vista 64
> and I'm using VirtualBox to r
following on from this...
I'm trying to do this now..
def self.find_nil_and_save(name)
resorts = Resort.find(:all, :conditions => {name => nil})
resorts.each do |resort|
puts resort.name + " #{name} is empty. Enter a value..."
new_value = gets.chomp
puts resort.name + "
Our Naperville, IL based startup is creating a new social networking
platform that businesses will be able to use to better brand and
market their business to their customers and their community. The
system has been built using Ruby on Rails and is very close to
completion. I have been working wi
On Sun, Apr 25, 2010 at 8:38 AM, RichardOnRails
wrote:
> I think I see the cause of lack of communication between params in
> Am I all wet about this?
Yes. I think you are totally missing how the Web works :-)
The params hash represents name/value pairs passed from a client
(browser, typically)
RichardOnRails wrote:
>>> forgot to engage brain
> The happens to me all the time. I retired a decade ago and I often
> can't remember what I did or intended five minutes ago. I've
> developed some techniques for combating this weakness, e.g.. when
> programming I log screen-shots of what I did an
I think I see the cause of lack of communication between params in
1) app\views\expenses\new.html.erb; and
2) app\views\vendors\show.html.erb
The are two distinct params, viz:
one in an instance of app\controllers\expenses_controller.rb;
the other in instance of app\controllers\vendors_controller
what I didn't mention and is the core of this problem, is that those
captcha parameters are salted, so they are different for each and every
client. That's why I need to access the initialized @captcha object...
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you
Thanks for the quick reply :)
> If you give filter_parameter_logging a block it will yield parameter
> names/values to that block and you can make the decision to filter on
> a case by case basis. Is that enough for you ?
I've tried this, but again the fact that filter_parameter_logging is a
cla
Well, you can use ranges with pdftk. Like
$ pdftk in.pdf cat 3-end output out.pdf
Catenates pages from third till the end. Here are good examples of pdftk
usage
http://www.accesspdf.com/pdftk/
On Sun, Apr 25, 2010 at 8:48 PM, Simon Macneall wrote:
> I don't think that you can explicitly do th
>> forgot to engage brain
The happens to me all the time. I retired a decade ago and I often
can't remember what I did or intended five minutes ago. I've
developed some techniques for combating this weakness, e.g.. when
programming I log screen-shots of what I did and what I got as a
result. It h
On 25 April 2010 16:03, RichardOnRails
wrote:
> Following up on what Bob Smith posted on 4/21 and Hassan Schroeder on
> 4/24,
> here's what I've got working:
>
> === app\views\vendors\show.html.erb =
> [snip]
> <%= link_to 'Edit', edit_vendor_path(@vendor) %> | <%# From scaffold -
> %
On Apr 25, 3:53 pm, Olivier Lance wrote:
> That's obviously not what I want. I thought I could add
> @captcha.fields[:password] as a parameter, but filter_parameter_logging
> is a Class method so @captcha is nil when it's called.
>
> I'm out of idea for this, would anyone have a solution or some
bill walton wrote:
> On Sun, 2010-04-25 at 16:49 +0200, bingo bob wrote:
>
> I'd try...
>
> def self.find_empty_things(name_of_attrib)
> Resort.find(:all, :conditions => ["#{name_of_attrib} IS NULL"])
Right. The OP's original approach involved fetching all the records
from the DB, them doing
Thanks Bill,
Thats looks like it'd work, in case it helps any, I ended up with...
def self.find_nil(name)
resorts = Resort.find(:all, :conditions => {name => nil})
resorts.each do |resort|
puts resort.name
end
puts resorts.length
end
which seems good.
Anyone with any t
Following up on what Bob Smith posted on 4/21 and Hassan Schroeder on
4/24,
here's what I've got working:
=== app\views\vendors\show.html.erb =
[snip]
<%= link_to 'Edit', edit_vendor_path(@vendor) %> | <%# From scaffold -
%>
<%= link_to 'Back', vendors_path %>
On Sun, 2010-04-25 at 16:49 +0200, bingo bob wrote:
I'd try...
def self.find_empty_things(name_of_attrib)
Resort.find(:all, :conditions => ["#{name_of_attrib} IS NULL"])
end
HTH,
Bill
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
T
Just curious if you tried removing the "config.ru" file from your
rails application's root directory? It seems to be a different error
than me but I thought I would throw it out there just in case it
helps.
My environment is:
FreeBSD 6.4
Ruby 1.9.1p378
Passenger 2.2.11
Rails 3.0.0.beta3
Hi,
I'm using the negative_captcha plugin for my signup form on a website,
and I'd like to have the parameters filtered out in my logs.
My problem is : negative_captcha replaces the parameters names with some
md5 hashes in a before_filter and leaves the uncrypted parameter as a
honeypot to identi
I'm trying to write some tools to help me clean up my data, first stop
is trying to find empty attributes in my Resort model...the following
works,
def self.find_empty_resort_heights
resorts = []
Resort.all.each do |resort|
if resort.TopLiftHeight.nil?
puts resort.name + "h
Anyone?
What I want is to inform Rails somehow that the json I want for the
comment should also contain information from the Post.
On Apr 24, 2:42 pm, Fabio Kreusch wrote:
> Hi all,
>
> Supponsing I have this:
>
> class Post < ActiveRecord::Base
> end
>
> class Comment < ActiveRecord::Base
> b
Hi,
I am learning Rails and have run into a bit of difficulty with something
I suspect is not uncommon, but I'm having difficulty getting my point
across to Google.
I have three models in an application designed to track events in time,
one model (a 'date' model) has a polymorphic relationship to
I don't think that you can explicitly do that with pdftk, but you can do
'burst' to break the pdf out into lots of single page documents, and then
'cat' to combine the pages that you want in the final document.
Simon
On Sun, 25 Apr 2010 21:46:23 +0800, jhaagmans
wrote:
Hi Vladimir,
Th
Hi Vladimir,
Thanks. The bit about paperclip processors is very helpful!
I've looked at pdftk though and couldn't find how to cut pages from
PDF files. Am I overlooking something? The idea is that we will
receive many different kinds of PDF-files including (for example)
author information that th
Colin Law wrote:
> On 25 April 2010 00:45, Mike P. wrote:
>>...
>> I think if people could just get over the "don't optimize too early"
>> mantra, and realize that this can't possibly be best move for everyone,
>> a lot of future stress could be avoided, for both the business owner and
>> the cust
Hey community,
since some day i dive into Rails and started with the basics for
developing applications. Yesterday i spend a lot of time for how to
create a remote'able link_to with parameters. What orginally should
worked is this code-sample:
<%= link_to "Click here", index_path, :remote => true,
Take a look at Paperclip Processors
Paperclip could use custom processors to do non-standart stuff with
attachments. You specify your processor name like:
has_attached_file :file,
:styles => {:original => {:processors => [:pdf_processor]}}
and you need to have a class in
lib/paperclip_proce
Hi all,
I'm finishing up on a project, which has a model with an attached PDF
file. I'm using Paperclip to process the attachment.
What I'd like to do is to enable users to cut (remove) the first x
pages from the PDF-file, but I have no idea how to do that. Is there a
gem that can do this? And ho
sair do grupo
queria um nacional
2010/4/24 hornairs
> I'm trying to create several large applications that share 60-80
> percent of their functionality. I'd like to find some way to abstract
> the common functionality into a gem, plugin, or engine which I can
> then deploy as many times as ne
MySql error in Ruby.
Where do I place libmySQL.dll requested not to give more this error?
Command rake db:CREATE and http://localhost:3000/project and show
the error.
The command "gem install mysql" was successful.
I'm new to RoR.
Thank you.
--
You received this message because you are
On Apr 25, 1:57 am, Scott Kulik wrote:
> I have a table for private messages similar to:
>
> PMS:
> title
> body
> sent_to (foreign key to users table)
> sent_from (foreign key to users table)
>
> When I originally set it up I didn't have it automatically a users pm's
> when that user was delete
On 25 April 2010 02:01, Louis-Pierre Dahito wrote:
> Hi guys!
>
> There's a problem I'm dealing with since 2 days now and I haven't quite
> figured out what's wrong in my code.
>
> Fetching records with the following command doesn't work:
>
> Comment.find :all, :joins => :story, :conditions => {:s
Hi,
I've still got things to learn about RoR - always will have I guess,
which is part of the enjoyment - and I would recommend having the
Pickaxe book (Programming Ruby) as close to hand as possible. AWDwR
was a good place to start for me, but as Rails is Ruby Code, I find
the Pickaxe more useful
On 25 April 2010 00:45, Mike P. wrote:
>...
> I think if people could just get over the "don't optimize too early"
> mantra, and realize that this can't possibly be best move for everyone,
> a lot of future stress could be avoided, for both the business owner and
> the customer.
Optimising "too e
On 24 April 2010 22:53, RichardOnRails
wrote:
> Hi Colin,
>
> I had to work on adding authenticated users to my app, so I had to
> back-burner the conditional-link issue. I nevertheless would like to
> keep trying to learn how to do this. Maybe CSS is the way to make the
> link switch between v
Fearless Fool wrote:
... which happens to generate an identical map. But Joe's mapping
syntax much more concise, and his explanation is great.
I can't take full credit for the syntax. I found it in the "Rails Routing
from the Outside In" guide [1] when double checking the syntax for shallow
"lgs" wrote in message
news:f40aaef6-8e69-49bd-91f6-dd5865cf5...@t36g2000yqt.googlegroups.com...
To have a shot at 3.0.0.beta3, I had just been trying "rails g
scaffold welcome" , then it come up I get a routing error to css which
will never display :
Started GET "/welcomes" for 93.34.177.13
Joe Smith wrote:
> The best of both worlds is shallow routes.
>
> For your example you would use:
>
> map.resources :landlords, :has_many => { :buildings => :tenants }, :shallow
> => true
>
> Hope that helps.
Very much. I've been playing with 'rake routes' and had arrived at
this:
map.re
71 matches
Mail list logo