I'm trying to get rails running with Nginx. I have Nginx installed using
Macports and I can get it running. But I can't stop it. This will not
work:
alias nginx-stop=sudo launchctl unload
/Library/LaunchDaemons/org.macports.nginx.plist
I get launchctl: Error unloading: nginx.
Using killall
On 16 July 2010 02:23, Matt Jones al2o...@gmail.com wrote:
On Jul 13, 7:47 am, Salil Gaikwad li...@ruby-forum.com wrote:
I want to validate that zip code entered by user is valid or not.
...
To further add to the confusion, will your application have any
Canadian users?
Or any other country
Hi,
I am new in ROR.
my current url is like:
http://rails-forum.com/profile.php?action=change_passid=41665key=DIa6MR9n
but i want to show this url like:
http://rails-forum.com/
through out site even we click any link on the site.
Please help me. How can i do this in ROR.
Thanks
Amit Jain
Thank you! it make me confident.
--
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
I'm getting the following bug when I try to run rake db:migrate in
Rails 3 beta 4:
$ rake db:migrate --trace
(in C:/Users/Adam/Documents/Aptana Workspace/QuestionBank)
default formats are encoded in ISO-8859-1
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute
Hi everyone,
I have a working named_scope here, however it's too cluttered.
Anyone got a better (more efficient) and concise alternative?
Thanks.
named_scope :filter, lambda { |*args|
if
args.first args.second == nil
Hello,
I am Amit. i am new to Rails. Please forgive me if ask any stupid
questions.
I have gone through this article. I am also suffering with the same
problem.
my website URL like this: http://127.0.0.0:3000/users/edit/30
I don't want to show the controller:users and action: edit.
I want to
On Jul 16, 11:42 am, Jermaine jermaine2...@gmail.com wrote:
Hi everyone,
I have a working named_scope here, however it's too cluttered.
Anyone got a better (more efficient) and concise alternative?
Thanks.
well named_scope :filter, lambda {|*args|
{:conditions = {:status = args.first,
Hi there
Has anyone got rails3beta4 and exception notification to work?
I can't :-(
Found Lawrences stuff here
https://rails.lighthouseapp.com/projects/8995/tickets/87-exception-notification-cannot-be-used-with-rails-3-beta-4
I can't even install the gem, let alone apply the patch, bundle
Sorted it out using interations
% @material_types.each do |mt| %
h2 %= mt.name % /h2
pNumber of %= mt.name % types: %=
Material.find(:all, :conditions = {:material_type =
mt.material}).count % /p
% if Material.find(:all, :conditions = {:material_type
=
In Rails, we can see the following for example (They are separate here):
:x=new_x
:y={:x=X.new}
From Ruby, I know that a hash has to be between { }, and the key is on
the left of = and the value to the right.
But, in the above examples we are seeing = everywhere! What is = ? Is
it like =
Abder-Rahman Ali wrote:
In Rails, we can see the following for example (They are separate here):
:x=new_x
:y={:x=X.new}
From Ruby, I know that a hash has to be between { }, and the key is on
the left of = and the value to the right.
But, in the above examples we are seeing =
Hi Fred,
Thanks for the suggestion. However what did you mean specifically with
your last comment?
With anything like this any time you save when building up the conditions
will be dwarfed by the time it takes to run the actual query
On 16 jul, 13:09, Frederick Cheung
Hello Amit!
What the purpose to hide the controller and action from URL?
You can use the Apache mod_rewrite itself to make this change. You will
need to know a little regex to make these changes.
Amit Jain wrote:
Hello,
I am Amit. i am new to Rails. Please forgive me if ask any stupid
Look at my response to your message how can i hide controller and action
name in url.
There is a link there to a Rails guide which explains all about Routing.
Routing is the part of rails that defined mapping a URL or URL pattern to a
controller and action.
At the moment you seem to be multiple
Thanks for the suggestion. However what did you mean specifically with
your last comment?
With anything like this any time you save when building up the
conditions
will be dwarfed by the time it takes to run the actual query
Putting words in Frederick's mouth, but it simply means that
What the purpose to hide the controller and action from URL?
To have nicer URLs? For example:
http://www.facebook.com/andyjeffriesrather than
http://www.facebook.com/user/show/andyjeffries
It's quite a common request.
You can use the Apache mod_rewrite itself to make this change. You will
You can add a custom route to do that, but with the pattern you suggest, it may
be tough to add other controllers as it breaks many rails conventions.
in Rails 2.3's routes.rb file:
map.edit_user :id, :controller = users, :action = edit, :id = /\d/
The regex on ID is to prevent this route from
Just add to your link:
:target = '_blank'
In your exemple, made this:
link_to foo, foo_path(foo), :target = '_blank'
Steve Murdoch wrote:
I'm having trouble writing the required javascript to open a link in a
new browser window in Rails3.
Previously, in rails2.3.x I could just do:
aaah I-C.
Okay thanks for clearing that up! great stuff
On 16 jul, 14:16, Andy Jeffries a...@andyjeffries.co.uk wrote:
Thanks for the suggestion. However what did you mean specifically with
your last comment?
With anything like this any time you save when building up the
conditions
Hi,
A Ruby question.
Anyone know a function that loops through an array and returns true if
any one element satisfies the condition but false if none satisfy the
condition? And it should do this in one line. Something like
any_bot_follower = followers.each {|f| return true if f.bot?}
The above
On 16 July 2010 13:48, Ram yourstruly.vi...@gmail.com wrote:
Anyone know a function that loops through an array and returns true if
any one element satisfies the condition but false if none satisfy the
condition? And it should do this in one line. Something like
You probably want .detect
An update on this - it seems to work if the line undef = is
removed from ActiveSupport::Multibyte::Chars
On Jul 16, 10:35 am, Adam adampennycu...@gmail.com wrote:
I'm getting the following bug when I try to run rake db:migrate in
Rails 3 beta 4:
$ rake db:migrate --trace
(in
You might want to split those two into named_scopes of their own
though - for more modularity and possible scope chaining opportunities
elsewhere in the code.
Handling whether one of those arguments, which I presume are user
entered, is blank can be handled in the controller.
On Jul 16, 5:32 pm,
:x=new_x
Here x is the key and new_x is the value.
:y={:x=X.new}
Here y is the key and another hash, {:x = X.new}, is the value. And
within this hash again, x is the key and X.new is the value.
--
You received this message because you are subscribed to the Google Groups Ruby
on Rails:
On 16 Jul 2010, at 13:33, Matt Davies wrote:
Has anyone got rails3beta4 and exception notification to work?
I can't :-(
Found Lawrences stuff here
https://rails.lighthouseapp.com/projects/8995/tickets/87-exception-notification-cannot-be-used-with-rails-3-beta-4
I can't even install the
On 16 July 2010 13:51, Michael Pavling pavl...@gmail.com wrote:
On 16 July 2010 13:48, Ram yourstruly.vi...@gmail.com wrote:
Anyone know a function that loops through an array and returns true if
any one element satisfies the condition but false if none satisfy the
condition? And it should
Cheers Peter
I got it to install as a gem in the end like so
gem 'exception_notification', :git =
'git://github.com/rails/exception_notification', :branch = 'master',
:require = 'exception_notifier'
And sticking this into the application.rb is not breaking the site on
startup
On 16 July 2010 14:19, Andy Jeffries a...@andyjeffries.co.uk wrote:
On 16 July 2010 13:51, Michael Pavling pavl...@gmail.com wrote:
You probably want .detect
Or Enumerable#any?
http://apidock.com/ruby/Enumerable/any%3F
any_bot_follower = followers.any? { |f| f.bot? }
Even better! As it just
Another option is to use the Rails 3 unobtrusive way of event
delegating those links:
- Add an attribute data-popup to your link_to if you want it to open
in a new window
With the jquery adapter, add to application.js inside the document
ready handler:
Hello Guys,
Very new to Rails an enjoying myself a great deal. Been playing around
with the ActionMailer today sending emails. I'm currently sending a
multipart email using the naming conventions for my views to send both
an HTML and a TEXT version of the content.
contact.text.html.erb
Hi!,
I am using PDFKIT gem on winows XP and it's not working.
Here is the error I get:
No such file or directory - which wkhtmltopdf-proxy
The same project works on my MAC.
I have also installed wkhtmltopdf on windows.
Are there any extra configuration steps for PDFKIT on windows?
Thanks!
--
On Jul 16, 1:48 pm, Ram yourstruly.vi...@gmail.com wrote:
Hi,
A Ruby question.
Anyone know a function that loops through an array and returns true if
any one element satisfies the condition but false if none satisfy the
condition? And it should do this in one line. Something like
any?
On 16 July 2010 12:37, Philrup p...@controlns.com wrote:
Sorted it out using interations
% @material_types.each do |mt| %
h2 %= mt.name % /h2
pNumber of %= mt.name % types: %=
Material.find(:all, :conditions = {:material_type =
mt.material}).count % /p
%
Hi,
I've got a Rails app working that includes two two classes, etc.:
Expense Vendor. I eventually learned that the mental concept I had
of their relationship should be express in Rails as:
class Expense ActiveRecord::Base; belongs_to :vendor; end
class Vendor ActiveRecord::Base;
On Jul 16, 3:32 pm, RichardOnRails
richarddummymailbox58...@uscomputergurus.com wrote:
Hi,
I've got a Rails app working that includes two two classes, etc.:
Expense Vendor. I eventually learned that the mental concept I had
of their relationship should be express in Rails as:
class
Hi Richard,
On Fri, Jul 16, 2010 at 9:32 AM, RichardOnRails wrote:
http://rails.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html
informs me that the following methods will be generated in Expense:
vendor
vendor=
vendor.nil
1. Are my expectations correct?
2. What do I
I have a client that has a Rails app that was built by someone that
didn't know what they were doing, at least from the standpoint of MVC,
and so rather than portioning out their business logic in different
controllers, they have a controller with hundreds of methods, totaling
60,000 lines of
Hi Fred,
Thanks for your timely response.
what makes you think they aren't there ?
I searched for them to no avail. Shouldn't they be in the
Expense model (app\models\expense.rb); or
Expense controller (app\controllers\expenses_controller.rb?
I made a case-insensitive search for
My thinking is that perhaps every time a page is rendered, a mongrel has
to instantiate this controller and that marshalling this into RAM is
very time-consuming. Or does a controller get loaded into RAM at server
startup and then the effect is not all that substantial for each page?
Any
what makes you think they aren't there ?
I searched for them to no avail. Shouldn't they be in the
Expense model (app\models\expense.rb); or
Expense controller (app\controllers\expenses_controller.rb?
No, they are dynamically defined and exist in memory only at runtime.
Welcome to
You're right, has_many :through is probably a better solution but if you
don't like that approach what would yours look like?
Thanks!
--
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
Personally I would get hold of the log files and see what methods (or
at least controller and actions) are being called the most and see
what sort of time they are taking. The users might be able to tell you
what appears to be the slowest parts of the system.
Then I would concentrate on those
Hi Andy,
expense = Expense.find(1)
= #Expense id: 1, vendor: Z01-2010.06.26 (Z01-Test), [snip]
expense.vendor.nil?
= true
quit
Welcome to dynamic objects and classes :-)
Thanks. This restores my faith in Rails and enhances my appreciation
of newsgroups, especially this one.
Now I've got
Not sure if this will help as I am running nginx in Ubuntu, but it took me a
bit to find this. These are the commands that work for me:
Stop nginx: sudo /opt/nginx/sbin/nginx -s stop
Start nginx: sudo /opt/nginx/sbin/nginx
2010/7/16 Pål Bergström li...@ruby-forum.com
I'm trying to get rails
Welcome to dynamic objects and classes :-)
Thanks. This restores my faith in Rails and enhances my appreciation
of newsgroups, especially this one.
Now I've got to put them to use!
Good luck.
Post back if you have any more problems.
Cheers,
Andy
--
You received this message because
I'm trying to create an Inventory application that has two models:
1- item
2- itemdetails
I have made a relationship between those two models, such that:
item has_many itemdetails
Once I try to create an item or itemdetail I get a NoMethodError as
follows:
On Fri, Jul 16, 2010 at 1:08 PM, Abder-Rahman Ali li...@ruby-forum.com wrote:
I'm trying to create an Inventory application that has two models:
1- item
2- itemdetails
I have made a relationship between those two models, such that:
item has_many itemdetails
Once I try to create an item
Leonardo Mateo wrote:
On Fri, Jul 16, 2010 at 1:08 PM, Abder-Rahman Ali li...@ruby-forum.com
wrote:
follows: http://pastie.org/private/wvqtorzl12vrkrudzc8ha
Have you run all your migrations? Do you have the price column in your
itemdetails table?
--
Leonardo Mateo.
There's no place
Does sequence have to do here?
I mean, if I create the scaffold item, must I IMMEDIATELY rake
db:migrate BEFORE creating the scaffold itemdetails?
In my tables, I can see that the items table has the required fields,
but itemdetails. You know the story :-)
Thanks.
--
Posted via
Abder-Rahman Ali wrote:
In Rails, we can see the following for example (They are separate here):
:x=new_x
:y={:x=X.new}
From Ruby, I know that a hash has to be between { }
But you are wrong. The braces can be omitted when there is no
ambiguity.
Any time you see =, a Hash is involved.
On Fri, Jul 16, 2010 at 09:02, Ram yourstruly.vi...@gmail.com wrote:
:x=new_x
Here x is the key and new_x is the value.
:y={:x=X.new}
Here y is the key and another hash, {:x = X.new}, is the value. And
within this hash again, x is the key and X.new is the value.
I think what's confusing
Hi,
I am trying to use redirect_to in one of my action in a controller class
I want it to redirect to another controller create action which is a
HTTP POST method, I tried different option but none of them seems to
work.
Here is my code
class HomesController ApplicationController
def login
On Fri, Jul 16, 2010 at 1:31 PM, Abder-Rahman Ali li...@ruby-forum.com wrote:
Leonardo Mateo wrote:
On Fri, Jul 16, 2010 at 1:08 PM, Abder-Rahman Ali li...@ruby-forum.com
wrote:
follows: http://pastie.org/private/wvqtorzl12vrkrudzc8ha
Have you run all your migrations? Do you have the price
On Fri, Jul 16, 2010 at 1:35 PM, Abder-Rahman Ali li...@ruby-forum.com wrote:
Does sequence have to do here?
I mean, if I create the scaffold item, must I IMMEDIATELY rake
db:migrate BEFORE creating the scaffold itemdetails?
No, no need to.
In my tables, I can see that the items table has
Further, you should strive to make all your partials accessible like
this, by using :locals in the render and in the partial expecting
variable, not @variable, if that makes sense.
Cheers
On Jul 15, 1:07 pm, Leonardo Mateo leonardoma...@gmail.com wrote:
On Thu, Jul 15, 2010 at 2:58 PM, Zack
Dave Aronson wrote:
On Fri, Jul 16, 2010 at 09:02, Ram yourstruly.vi...@gmail.com wrote:
� :x=new_x
Here x is the key and new_x is the value.
:y={:x=X.new}
Here y is the key and another hash, {:x = X.new}, is the value. And
within this hash again, x is the key and X.new is the value.
Hi,
Is there a way to start Acrrobat reader on my local desktop by a ruby
application running on the server by launching : system(AcroRd32.exe
?
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups Ruby
on Rails: Talk group.
David Kahn wrote:
Not sure if this will help as I am running nginx in Ubuntu, but it took
I run it on my mac but I plan to install it on a VPS with Debian 5 so
it's good to know. Did you install it using Passenger or apt?
--
Posted via http://www.ruby-forum.com/.
--
You received this
Post back if you have any more problems.
Thanks for your generous offer. So here's my last (I hope) stumbling
block. I got:
NoMethodError in Expenses#new
Showing app/views/expenses/new.html.erb where line #14 raised:
undefined method `merge' for :nickname:Symbol
Extracted source (around
2010/7/16 Mamadou Touré li...@ruby-forum.com:
Hi,
Is there a way to start Acrrobat reader on my local desktop by a ruby
application running on the server by launching : system(AcroRd32.exe
I believe not, that will run it on the server. Would you want a
website to be able to run applications
On 16 July 2010 20:31, RichardOnRails
richarddummymailbox58...@uscomputergurus.com wrote:
Post back if you have any more problems.
Thanks for your generous offer. So here's my last (I hope) stumbling
block. I got:
NoMethodError in Expenses#new
Showing app/views/expenses/new.html.erb where
Robert Walker wrote:
I also wanted to point out that there is a new optional syntax for
hash key/value pairs introduced in Ruby 1.9:
{ :x: y } same as { :x = y } same as :x: y same as :x = y
[CORRECTION] Sorry, the above syntax is not quite right.
New 1.9 syntax should be:
y = 10
{ x: y }
Ok, first, yes, I am using Passenger/Nginx combination. Maybe this will help
---
If you are not planning on using SSL with it then you can
gem install passenger
passenger-install-nginx-module
And this worked great until I tried to get ssl up. As I found out the hard
way, if you want ssl you have
Hi Bill,
I didn't notice your response a while ago. I did try out all three
method displays. They all returned a slew of methods, even the most
restrictive one, private_methods.
One of the strangest results to me is:
expense = Expense.find(:first)
= #Expense id: 1, vendor: Z01-2010.06.26
Hey Colin,
If you use collection_select on its own you need to pass the object,
but f.collection_select inside a form_for takes the object from
form_for.
Awesome insight! Thanks. I've been trying for days to dig myself out
of this blunder.
Idle question: Do you know whether that distinction
Here are the details I intended to add to my last post:
expense = Expense.find(:last)
= #Expense id: 5, vendor: nil, description: Chose vendor
5/21/2010, category: cat, account: act, [snip]
Best wishes,
Richard
--
You received this message because you are subscribed to the Google Groups
Hey Colin,
Here's one more detail I should have added from my new-expense-view
code:
%= f.label :vendor %br /
%# New version of vendor selection -%
% params[:expense] = 10 -%
% @vendors = Vendor.find( :all, :order=nickname ASC) -%
%= f.collection_select(:id, @vendors, :id,
Hello together,
in CentOs i have to send a kill -9 2134. The last number is nginx's
process id.
Maybe that helps someone.
--
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,
Dan Lenz wrote:
Hello together,
in CentOs i have to send a kill -9 2134. The last number is nginx's
process id.
Maybe that helps someone.
also tried in a ubuntu vm a second ago. also works this way here... so
it should also work in debian.
--
Posted via http://www.ruby-forum.com/.
--
I am looking at rails edge source code.
I am able to do
puts User.find.to_yaml
However I am not able to find piece of code where 'def to_yaml' is.
How this to_yaml serialization is working?
can fully understand how to_json and to_xml is working but to_yaml
beats me.
Thanks
--
You received
71 matches
Mail list logo