Based on the principle of least surprise, you've got two cases you need to
plan for:
1. The user explicitly requests the login page, and so after a successful
login, you send him back to the page he came from.
2. The user requests a protected action that requires login, so you
Thanks for your reply,
but
1. this specific plugin did not have an install.rb with it.
2. 2.2.2 is as new as they get I just downloaded 3 weels ago...?! And
i think it works just fine with git as I have downloaded from git as
well (though it messed my tortoise svn structure pretty badly)
Then
I ran into this same issue, it has nothing to do with Rails. This
looks to be an issue with the way WebKit (used by Safari and Chrome)
handles javascript and form submits. Looks like if there is a onclick
on a submit button, data from the form is not submitted when the page
is posted.
On Dec
I'm getting a NoMethodError using Rails 2.1.0 when trying to send an
email using ActionMailer. The error is being thrown from the
template_format method in ActionView's base.rb file. Apparently the
controller.request object is an instance of DummyClass (according to
the exception trace)
On Feb 13, 11:29 pm, ericindc ericmilf...@gmail.com wrote:
I want my first check to verify email address uniqueness. If this
validation fails, there's no reason to go further with validating the
user's input. I want a singular message displayed in this case. Is
there a way to do this?
I
On Feb 14, 6:36 am, Vetrivel Vetrivel rails-mailing-l...@andreas-
s.net wrote:
How to convert params variable as hash.I am not able to convert params
as a hash.
If you are talking about the params variable you get in your
controller actions, it's already a hash. Perhaps you can clarify what
On Feb 14, 12:43 am, Chris csw11...@gmail.com wrote:
Hi all,
I'd really appreciate any help / advice on this problem. When I test
this
def edit
@entity = Entity.find(params[:id],
:include = :key_factors)
@traits = Trait.find :all,
On Feb 14, 1:26 am, Joshua Partogi joshua.j...@gmail.com wrote:
All,
I have a many_to_one relationship object between products and
categories and I want to return the category too using JSON results
but it seems that rails only gives back the products JSON object on
the view layer. This
On Feb 13, 11:39 pm, Enzo Rivello rails-mailing-l...@andreas-s.net
wrote:
Hi there!
I need to use observe field to change dynamically one select field based
on another select field:
here is the view:
%= observe_field 'class', :url = { :action = 'update_list' },
:frequency =
On Feb 14, 9:58 am, Spiros K. spiros...@gmail.com wrote:
Thanks for your reply,
but
1. this specific plugin did not have an install.rb with it.
2. 2.2.2 is as new as they get I just downloaded 3 weels ago...?! And
i think it works just fine with git as I have downloaded from git as
well
On 14 Feb., 03:56, Robby Russell ro...@planetargon.com wrote:
You might consider using Exceptional for this.
*http://getexceptional.com/
Thank you, Robby. The problem is that I want to build the database
exception logging into the Rails web interface of a free software
project.
xeon wrote:
Hi,
I would like to know for each running model action, how can I retrieve
the SQL running behind? I don't want to scan log each time for the sql
running behind.
E.g. post.find(:all,:conditions={:id='1'}
I wanna debug the sql generated behind, is that other shorthand
Srividya Sharma wrote:
Hello
I am using Rails 2.2.2.
Here is my problem:
I have a controller action which will receive several parameters,
validate them, process them and create a new set of parameters out of
them.
Then, this controller should delegate the task to another controller
On Feb 14, 3:32 am, Ken Lim rails-mailing-l...@andreas-s.net wrote:
MaD wrote:
well, the error-message is pretty clear:
The error occurred while evaluating nil.user
2: %= link_to #...@photo.user.username}'s Photos,
@photo seems to be nil. the reason for it can be found in your
Nice to see a response. The other method is in another controller. And
the other method needs to use send_data. (basically write a response)
So I cannot use a simple class, include that class in the first
controller.
since the other method has to write out a response, it needs to be in
another
Hi,
I am increasingly needing to do some more complex finds involving
several table associations. I can usually find an SQL solution, but
find it hard to think these out using ActiveRecord find techniques. I
guess I am thinking in SQL terms, when perhaps there is a way of
thinking in
Peter,
The dramatic
improvement in ping time does make quite a difference to be honest,
Confirms what I was what I was wondering about.
Had a look at bytemark, they look worth following up.
Thanks
Tonypm
--~--~-~--~~~---~--~~
You received this message
On 14 Feb 2009, at 11:33, tonypm wrote:
Hi,
I am increasingly needing to do some more complex finds involving
several table associations. I can usually find an SQL solution, but
find it hard to think these out using ActiveRecord find techniques. I
guess I am thinking in SQL terms, when
tonypm wrote:
Repair has_many :notes
SELECT * FROM repairs
where exists
(select * from notes where repairs.id=notes.repair_id
and and notes.flagged)
r = Repair.find(...)
notes = r.notes.find_by_flagged(true)
I can't think of a way to learn how deep the ActiveRecord DSL
two suggestions:
1. set a debugger at the beginning of you show-method. that way you
will find the reason for @photo being nil.
2. since Photo.id is your primary key (and therefore unique) you could
just do your find like this:
@photo = Photo.find(params[:id])
instead of the much longer:
Frederick Cheung wrote:
Repair has_many :notes
SELECT * FROM repairs
where exists
(select * from notes where repairs.id=notes.repair_id
and and notes.flagged)
I forgot my basic SQL! I think that's just
SELECT * FROM repairs r, notes n
WHERE r.id = n.repair_id
AND
Darn,
I returned an array object besides that products instance, giving that
to_json will give backslashes to the quotes.
On Feb 14, 9:31 pm, Frederick Cheung frederick.che...@gmail.com
wrote:
On Feb 14, 1:26 am, Joshua Partogi joshua.j...@gmail.com wrote: All,
I have a many_to_one
Thanks for the response.
I'm still not sure how I'll approach this. I'm going to spend a bit
of time tinkering with the :if option, as well as creating my own
validation function. I agree that it is annoying for the user to have
to correct errors one at a time. But I'd imagine correcting a
Just to finish the story.
Sorry - the distinct in the select is needed, I missed it out.
Going a step further, I now have:
named_scope :flagged_repairs, :select = 'distinct repairs.*', :joins
= :repair_notes, :conditions = [notes.flagged = ?, true]
So in my search, where I am building a
Richard Schneeman wrote:
Danimal wrote:
Richard,
I am having exactly the same problem. Everything works on my macbook
pro. But on my deployment server I get the same error.
I'm still looking. Hopefully I can find a solution. Like you, I'm
having trouble with RMagick. Plus I like
Fred,
Repair.find :all, :select = 'distinct repairs.*', :joins
= :notes, :conditions = [flagged = ?, true]
nice - many thanks. just needed to fix notes.flagged
--
In reality I have a generic notes model, so my usage is slightly more
complex:
In Repair I
hello..
I am new to Ruby on Rails.. (2.2)
I am currently following steps from the book agile web delopment with
Rails building depot application.
It says I need to edit app/models/product.rb file and add the
following lines to check the price to be at least a cent.. that's 0.01
def
I use rails 2.2.2
Backgroundrb version (latest from svn)
--
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
i just tried it for myself. it's working correctly. so i advice to put
a debugger at the beginning of your action and look what you are
getting for price and where the error occurrs (whether it's inside
that method or even before).
--~--~-~--~~~---~--~~
You
Hi,
I have used backgroundrb plugin in my application,
I followed the tutorial in,
http://backgroundrb.rubyforge.org/
Everything works fine,
When I run rake backgroundrb:setup,
It created the required scripts, and backgroundrb.yml but the mirgation
files were missing.
Can some one help me out
On our production servers, I'd like all exceptions to be automatically
logged to the database.
In other C# project I wrote that meant putting a try/catch in every
entry point method with the catch calling a generic routine which did
the INSERT into exceptions... SQL statement.
How do I do this
On Saturday 14 February 2009 12:52 am, Valentino Lun wrote:
Is it possible to do this in my crontab as follow?
10 10 * * * wget http://localhost:3000/cron/someaction para1 para2
I'm not sure, but an alternative is to put the wget command in a small
shell script (Linux talk, iiuc) or a .bat
which ruby version are you using? I think I had a similar problem
using ruby 1.8.7 and solving it by downgrading to 1.8.6...
On Fri, Feb 13, 2009 at 5:23 PM, Sean McGilvray smcgilv...@gmail.com wrote:
Hi all,
I am using ar_mailer for sending newsletter. I got mails queued in
emails table.
Actionmailer is a bit different because the mail has it's own view
which has no controller. You'd have to pass the controller in through
the message to the mail when you're delivering or building it.
Blog: http://random8.zenunit.com/
Learn rails: http://sensei.zenunit.com/
On 14/02/2009, at
Hi.
I want to serialize out an object to the database. But I am getting an
integer value in the column when I expect to see some yaml!
migration:
class CreateSummaries ActiveRecord::Migration
def self.up
create_table :summaries do |t|
t.text :summary_data
t.timestamps
end
Yes, the plugin IS in vendor plugins and YES you can check my first
post in the thread and see that my 2nd post was actually a typo in my
behalf. The problem remains as stated.
BTW, the code was copy-pasted from tutorials that supposedly work, so
I doubt there is any weird typo in the actual
Bpx Bpx wrote:
Hello,
I was searching for some way to secure my rails scripts. Do anybody know
what can I use? I found Rencoder (www.rencoder.com) on the net but I
want to know if there are others programs I can use?
Well, definitely don't use this Rencoder. Its not secure and frankly it
No quite like that. If you're sending an HTTP GET request to any URL, you
would pass parameters to the URL itself, something like:
http://localhost:3000/cron?param1=value1param2=value2 etc
What looks attractive to me about this approach (of using wget via cron
instead of a rake task) is that you
On Feb 14, 3:52 pm, Spiros K. spiros...@gmail.com wrote:
Yes, the plugin IS in vendor plugins and YES you can check my first
post in the thread and see that my 2nd post was actually a typo in my
behalf. The problem remains as stated.
odd. i'd stick a breakpoint in the plugin's init.rb to
OK Well this must be a bug I guess but I managed to get it to work.
For some reason the first one was trying to give the js response to
the action. So for the hey of it I used 3 button_to's and the bottom
two worked while the first one was giving me the same response.
div style=display:
On Feb 14, 5:54 pm, Me chabg...@gmail.com wrote:
OK Well this must be a bug I guess but I managed to get it to work.
button_to generates a form for you with a button. You've put a button
in a form, therefore in the generated html there will be a form nested
inside a form which isn't valid
I have recently setup restful_auth.. on 2.2.2 and all the unit tests passed
except for a little correction in the users.yml (fixture)
I have been able to successfully create and activate users.
I did setup with acts_as_state_machine (AASM) too.
Some things I would check-
Did the migration
I use new in almost all my controllers, but sometimes I have seen the
build method inside the controllers of some apps. Can someone explain
when should I use build?
--
Posted via http://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because
John Smith wrote:
I use new in almost all my controllers, but sometimes I have seen the
build method inside the controllers of some apps. Can someone explain
when should I use build?
.build fixes the fact you cannot say this:
my_post.tags.new(:name = 'reggae')
The new() operator is
On Feb 13, 11:42 am, Sarah Allen rails-mailing-l...@andreas-s.net
wrote:
I'm picking up a Rails app that is using a lot of older gems. We're
using Rails 2.0.2 and planning to move to to Rails 2.3 along with
upgrading the the dependencies. However, in the meantime, we're moving
servers
Summary.new is expecting to receive a hash, which isn't what you're
giving it.
i.e.:
summary = Summary.new( :summary_data = { name=Administator,
login=admin } )
summary.save!
Summary.last.summary_data
= {name=Administrator, login=admin}
On Feb 14, 5:29 am, phil p...@philsmy.com wrote:
Hi.
I
On Feb 14, 2009, at 2:37 PM, Phlip wrote:
John Smith wrote:
I use new in almost all my controllers, but sometimes I have seen the
build method inside the controllers of some apps. Can someone explain
when should I use build?
.build fixes the fact you cannot say this:
(bump) still really keen if someone has any info on this one (see below)
2009/2/10 Greg Hauptmann greg.hauptmann.r...@gmail.com
Still stuck on this. I made sure I wasn't in the current directory when
I did the call to reaper and I still get the same result, i.e. whilst the
process restarts
Matt Jones wrote:
Take a careful look at the errtheblog article - you should be using
require, not gem here.
The gem statements only add the gem directories to the load_path.
Changing to 'require' got past that error. I still don't understand why
it failed to load since I had requires
On Feb 13, 9:49 am, Rob Pa rails-mailing-l...@andreas-s.net wrote:
Michael Mike wrote:
Did you find a solution to this? I am experiencing the same problem.
I contacted my host and got them to update my Ruby Gems.
However I now get this message;
:0:Warning: Gem::SourceIndex#search
Hey all,
I have a pretty simple question, but I'm not sure of a good solution
to it. Essentially, I want to provide a two-to-one mapping of models.
I'm working on an application for a contest, where every (unordered)
combination of two Rounds is supposed to be assigned to one Room. Any
Room
build does not save the object. create does. if saving fails, create
returns false, create! raises error (useful in migration, will
rollback)
On 14 Ún, 20:37, Phlip phlip2...@gmail.com wrote:
John Smith wrote:
I use new in almost all my controllers, but sometimes I have seen the
build
named scope is definitely the way to go. check out
http://guides.rubyonrails.org/active_record_querying.html#_named_scopes
for more options (especialy named scope with argument)
On 14 Ún, 13:32, tonypm tonypmar...@hotmail.com wrote:
Just to finish the story.
Sorry - the distinct in the
The problem is with your path. You want /System/Library...
but you are doing -/System/Library...
See the difference?
Cheers--
Charles
On Fri, Feb 13, 2009 at 3:35 PM, elle wazne...@gmail.com wrote:
gem list -d rails gives me:
*** LOCAL GEMS ***
rails (2.2.2, 1.2.6)
Author: David
Excellent! Thanks for the clarification, Fred! I think adding the
trait_values as an inner join will do the trick.
-Chris
On Sat, Feb 14, 2009 at 5:26 AM, Frederick Cheung
frederick.che...@gmail.com wrote:
On Feb 14, 12:43 am, Chris csw11...@gmail.com wrote:
Hi all,
I'd really
Hey there,
I am trying to figure out routing and thought that this would probably
be the best way to learn how to do some complicated routes. I've
looked at a lot of people's methods for getting the /articles/
2009/02/12/some-title to work but they all seem to forget to post some
custom method
Hi there, I am trying to deploy a rails app on dreamhost.
Here is the error message that I get:
fatal: 'home/USER_NAME/DOMAIN_NAME/git/APPLICATION_NAME.git': unable
to chdir or not a git archive
fatal: The remote end hung up unexpectedly
Try to remove the set :deploy_via, :remote_cache, could never get it to work.
-
Maurício Linhares
http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/ (en)
On Sat, Feb 14, 2009 at 10:51 PM, olivierntk olivier...@gmail.com wrote:
Hi there, I am trying to deploy a rails app
Looking at the print from capistrano:
fatal: 'home/USER_NAME/DOMAIN_NAME/git/APPLICATION_NAME.git':
unable ???
That just does not look right.
From the host where you have capistrano are you able to run git clone
and the git url ?
Here is a git example url
set :repository,
Gems might be installed in more than one area.
Look in ~/.gems and make sure that you use sudo when installing gems.
Do you now have multiple ruby directories on your mac? if so you most
likely have multiple gems directories too...
what I found was best when I upgraded from 1.8.6 to 1.8.7 was
Imagining that every round must belong to a room, here's a simple and
straightforward implementation:
class Room ActiveRecord::Base
# this class needs a max_rounds and rounds_count integer columns
has_many :rounds
def accepts_more_rounds?
max_rounds rounds_count
end
end
class
That's a clean solution, however I don't know if it satisfies the fact
that any Room might have many different combinations of Rounds
Not sure I understand correctly, but if a room can have many
combination of rounds, and each combination of rounds has more than
one round, you could try this:
Hi all,
I just finally figured out how to get 2.2.2 to do this, and thought
I'd share in case others run into the same thing.
The situation is a find with associations, but the tricky part is that
the association shouldn't always be loaded. This is similar to putting
a condition on a has_many
How do I pass the controller through so that a method like
template_format will pick it up and use it? Or is there some way to
avoid that method being called altogether?
Thanks,
Michael
On Feb 14, 2009, at 8:27 AM, Julian Leviston wrote:
Actionmailer is a bit different because the mail
Ive googled this and searched here and other forums but not getting
appropriate reuslts. Perhaps someone on the board can help.
All i want to do is to have a button/link on a page such as add task
which when pressed will insert the appropriate form plus fields directly
under the button/link. Im
Cool! Harold, your solution strikes me as being exactly the way to do
it. I've implemented it, and things seem to be sailing smoothly.
Thanks a lot to both of you.
Sincerely,
Greg
On Feb 14, 11:47 pm, Harold harold.gime...@gmail.com wrote:
That's a clean solution, however I don't know if it
Great! Glad it worked.
On Sun, Feb 15, 2009 at 1:57 AM, Greg gregory.brock...@gmail.com wrote:
Cool! Harold, your solution strikes me as being exactly the way to do
it. I've implemented it, and things seem to be sailing smoothly.
Thanks a lot to both of you.
Sincerely,
Greg
On Feb
67 matches
Mail list logo