On Jul 28, 4:22 am, isyairazu wrote:
>
> $ sqlite3 db/development.sqlite3
> sqlite> select * from balances;
> //=> |xxx|10|1||...
> // equal is not 9
>
> Even create_or_update() was the same.
>
fixtures are directly inserted into the db
> Should I write it as
> equal: 9
> in the fixture-file
Well, from the log as far as i could tell: it was no where in MY code,
but everything in rails code.
So it seemed there was no easy way for me to interfere easily.
But luckily, as is often the case, the problem/bug was a stupid
mistake.
My class is called EnvelopesController, and what did i want
I figured out the solution for the YAML problem. RAILS_ENV has changed
to Rails.env. I changed it and it work. I still have problems with the
pluralize method though.
Any help is appreciated
On Jul 28, 12:45 am, elioncho wrote:
> Hi,
>
> I just upgraded my rails app from rails3.0.0beta4 to rails
Hi,
I just upgraded my rails app from rails3.0.0beta4 to rails3.0.0rc and
I'm having problems loading a yaml file. I have a load_config.rb in
the initializers folder which loads a yaml file. The basic loading
code is:
FACEBOOK_CONFIG = YAML.load_file(File.join(Rails.root, 'config',
'facebooker.ym
I'm looking to build a web interface for an existing Ruby app and I'm
trying to figure out which version of Rails to use - 2.3 or 3.0.
The reasons for using 2.3 are pretty straightforward: it's stable and
I can buy a number of books on it.
My reasons for considering 3.0 are:
- My app uses Ruby 1.
Hello,
$ ruby script/generate model balance plus:integer minus:integer
equal:integer
$ cat app/models/balance.rb
class Balance < ActiveRecord::Base
def save
self.equal = self.plus - self.minus
super
end
end
$ cat test/fixtures/balances.yml
_10-1:
plus: 10
minus: 1
$ rake db:fixt
Hey guys. In Rails 2, is there a way to create a route at run-time? I
want to do this because a gem that I'm writing requires a single
resource route, and I'd prefer that the gem create it at run-time
instead of forcing the user to define the route in routes.rb .
While trying to figure this out, I
Thank for the reply!
I have to admit that I don't send a lot of time on this list - just
when I am stumped on something that I've spent way to much time trying
to figure out. Half the time I'll just post a question, hoping that,
even if I don't get a reply, it will drive me into figuring it out fo
Steve,
The general mailing list is pretty overwhelming to those that want to spend
a bit of their time trying to help the freshman class of Rails. Probably
almost as overwhelming as rails is to the people new to the framework.
Personally, I'm able to make better use of my time by helping contribu
Craig White wrote:
> On Wed, 2010-07-28 at 01:27 +0200, Fearless Fool wrote:
>>
>> Thanks!
>
> nobody can PM you since you didn't give a PM address
>
> Craig
Craig:
Try clicking on the fearless_fool link at the top of the message (aka
http://www.ruby-forum.com/user/show/8715) and see if t
As of this post time, there were 33 posts out of the last 120 that
were not answered.
I understand that there are a lot of RTFB type questions on this list,
but this list that has basically been useless. Where do you go to find
help on something other than a RTFB type question?
Steve Alex
--
Y
On Wed, 2010-07-28 at 01:27 +0200, Fearless Fool wrote:
> Our startup is about to leave the hushed darkness of the lab and step
> into the light by launching a web-based application. Our team has
> written the core "secret sauce", but we need a fast and accurate RoR
> development team or individua
I use authlogic for authentication and paperclip for handling user's
profile picture attachments.
I use the following method to get the current_user
def current_user_session
return @current_user_session if defined?
(@current_user_session)
@current_user_session = UserSession.fi
Our startup is about to leave the hushed darkness of the lab and step
into the light by launching a web-based application. Our team has
written the core "secret sauce", but we need a fast and accurate RoR
development team or individual to assemble a framework around the core
and to deliver a packa
I have a simple blog app that lets me create an entry with title and a
body... real simple.
In addition to the id that the database creates by default per each
entry I would love to associate an unique id that uses
0123456789 and the 26 letters of the English alphabet.
So that means I have 36^7 u
Quoting Eric Yen :
> Hi,
>
> I want to write a functional test using the default test unit that is
> included with rails 3.
> Is there a way to skip a setup call?
>
> So I'm trying to test the users controller.
> But to access those actions, I need to be logged in. So I put a login
> algorithm i
So I strip it down to
page.replace_html('aremark', :partial => "content")
Still won't work without refreshing the page
Frederick Cheung wrote:
> On Jul 27, 8:56�pm, Neil Bye wrote:
>> This is create.rjs
>>
>>
>> aremark = page.getElementById("aremark")
>> page.replace_html('aremark', :partial
On Jul 27, 8:56 pm, Neil Bye wrote:
> This is create.rjs
>
>
> aremark = page.getElementById("aremark")
> page.replace_html('aremark', :partial => "content")
>
>
This is weird - if it's an rjs file you don't want script tags - an
rjs file only contains ruby.
Fred
> This was working then didn't
On Jul 27, 10:09 pm, badnaam wrote:
> I notice that there is a line in the logs called User Columns (1.3ms)
> [0m [0mSHOW FIELDS FROM `users` [0m, anytime I issue a query
> against a model, even if the queries don't do anything to the user
> model. This happens even on the console.
>
> Any id
On Jul 27, 7:59 pm, Eric Yen wrote:
> Hi,
>
> I want to write a functional test using the default test unit that is
> included with rails 3.
> Is there a way to skip a setup call?
>
> So I'm trying to test the users controller.
> But to access those actions, I need to be logged in. So I put a l
I notice that there is a line in the logs called User Columns (1.3ms)
[0m[0mSHOW FIELDS FROM `users` [0m, anytime I issue a query
against a model, even if the queries don't do anything to the user
model. This happens even on the console.
Any ideas where this is coming from? Whats the best way
Fernando Perez wrote:
> Hi,
>
> In my functional tests it was convenient to use:
>
> @controller.expects(:admin?).at_least_once.returns(true)
>
> to simulate requests which come from an admin user. But it seems that in
> Rails 2.3.8 it's gone away. What replaces it now?
Anyone? Currently my app
So, I had an extra end in the method above my update method in the
controller, lol silly error
Jennifer
--
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 rub
Aha, I think I've finally figured it out with named routes!
However my named route only works when its on the top line, and I need
to make a static map.connect above it or the web app wont work; why
does it make me put it at the top (there is nothing overwriting it or
anything below). When it's not
> Are you looking for something like p or inspect ?
Damn' it! I completely forgot about Hash#inspect! Thanks Marnen :)
--
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
Neil Bye wrote:
> I have a form that accepts comments and adds them to a list without
> refreshing the page.
>
It should read
I want a form that accepts comments and adds them to a list without
refreshing the page.
--
Posted via http://www.ruby-forum.com/.
--
You received this message because
I am attempting to create a model called "encyclopaedia" with multiple
sections of encyclopaedia articles, each section having an image.
When I attempt to upload an image, I get the error:
Unknown action
No action responded to upload. Actions: create, destroy, edit,
get_encyclopaedia, index, is
I have a form that accepts comments and adds them to a list without
refreshing the page.
This is the html:
<%= render :partial => 'comment' %>
<% remote_form_for :comment, :url=>story_comments_path(@story), :html
=> { :id => 'comment' } do |form| %>
Make a comment:
<%= form.te
Hi,
I want to write a functional test using the default test unit that is
included with rails 3.
Is there a way to skip a setup call?
So I'm trying to test the users controller.
But to access those actions, I need to be logged in. So I put a login
algorithm in my setup.
But I do not need to be l
Charles Wang wrote:
> I use rails-3.0.0.beta3 and ruby-1.9.2-preview3.
>
> I have defined some new methods in the application_controller.rb, and
> need to test them in the consle.
>
> If I changed some codes in the application_controller.rb.
> I should always restart the console.
>
> I have trie
Fernando Perez wrote:
> Hi,
>
> When rails raises an exception which file (view?) gets rendered and
> outputs in the browser the backtrace, request, parameters, etc.
>
> I'm asking that because I'd like to know if Rails provides an easy way
> to convert a hash to a readable string, eg:
>
> "{:ke
Is it potentially dangerous to use an ActiveRecord model in routes.rb?
Here's a line from our routes.rb file:
> map.resources :registrations, :requirements => { :id => User::USERNAME_REGEXP
> }
Registration#to_param returns the User's username.
User::USERNAME_REGEXP is just a regex that matches o
On Tue, Jul 27, 2010 at 11:48, nathanvda wrote:
> When i go to my first view, i get this very weird error:
>
> wrong number of arguments (2 for 0)
That means you're calling some function/method that's expecting no
arguments, and you're giving it two.
> It goes wrong in the callbacks, in the fol
oops..
Replace this one line in the previous post I made to:
set :repository, "ssh://g...@your_git_server:your_git_port/path/to/git/
repository"
This will get your source from your remote git server. The previous
one is assuming that you already have a copy of the git repository
locally.
--
Y
I use this script, and it works for me (although, I'm sure I could
improve it..) - hope this helps!
START deploy.rb =
set :application, "MY_APP"
set :user, "your_username"
set :admin_runner, user
set :rails_env, 'test'
set :deploy_to, "/path/to/MY_APP/#{application}"
On Jul 27, 4:35 pm, Pål Bergström wrote:
> Robert Walker wrote:
> > Rack is a dependency of Rails so it will get installed when you install
> > the Rails gems. Also keep in mind certain versions of Rails requires a
> > certain version of Rack. Sometimes even an older one than the current.
>
> >
Ok, I think I've made a tiny bit of progress. I've got the URLs I want
to work using routes.rb
I now just need to application to link to the right place, Im trying
to get it to go to "CATID/ID" but it links to "categories/ID?
cat_id=CATID".
I'm giving it all of the correct parameters that my rout
Hi there,
I have a Rails application I developed using Rails 3.0.0.beta4. Up
until now no views were needed. My controllers just rendered text and
status (webservice).
Now i needed my first UI, i upgraded to rails 3.0.0.rc and i am for
the first time working with haml.
When i go to my first view
I development mode, cache is disabled.
On Jul 27, 3:47 am, Andy Jeffries wrote:
> Sorry, no idea.
>
> (just to let you know that you're not being ignored it's just likely that
> no-one has an answer for you, this generally works fine for me).
>
> --
> Andy Jeffrieshttp://andyjeffries.co.uk/ #
Pål Bergström wrote:
> Greg Donald wrote:
>
>> I would just add the functionality to ActiveRecord:
>
> Where does the unique aes key comes in, the user cookie?
It's a unique user key for use with fast_aes in order to encrypt certain
data in the database.
--
Posted via http://www.ruby-forum.com
Dave Aronson wrote:
>> For now just over http. But eventually with ssl.
>
> Before this goes live?
>
>
Yes. It doesn't matter. The key in the cookie has nothing to do with the
overall security. It's just an extra layer of security for the user,
encrypted with aes. E.g. I don't want to see cer
2010/7/27 Pål Bergström :
> Dave Aronson wrote:
>
>> Are you doing this over https, or just plain http?
>
> For now just over http. But eventually with ssl.
Before this goes live?
-Dave
--
Specialization is for insects. -RAH | Have Pun, Will Babble! -me
Programming Blog: http://codosaur.us |
Dave Aronson wrote:
> Are you doing this over https, or just plain http?
For now just over http. But eventually with ssl.
--
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,
On 27 July 2010 08:59, Mohammed Alenazi wrote:
> Hi
> I have two tables: users and tickets. A user has many tickets which is
> defined in the model. I want to order the users based on the number of
> tickets they have. What is the easiest way to do it in Rails without
> writing to many SQL stateme
On Tue, Jul 27, 2010 at 05:36, pepe wrote:
> Maybe adding 2 integer columns to your Posts table to count the hits?
>
> When somebody rates the Post you just add 1 to whichever column you
> need. Then it would be a simple matter of sorting your posts in
> ascending/descending sequence by the column
2010/7/26 Pål Bergström :
> What I want to achieve is to aes encrypt selected columns in the
> database using a key stored in the users browser as a cookie.
Are you doing this over https, or just plain http?
-Dave
--
Specialization is for insects. -RAH | Have Pun, Will Babble! -me
Programming
On Mon, Jul 26, 2010 at 19:09, Fernando Perez wrote:
> I'd like to know if Rails provides an easy way
> to convert a hash to a readable string, eg:
>
> "{:key => 'value'}" instead of yukky #to_s which gives "keyvalue".
Maybe you can override to_s?
-Dave
--
Specialization is for insects. -RAH
Robert Walker wrote:
> Rack is a dependency of Rails so it will get installed when you install
> the Rails gems. Also keep in mind certain versions of Rails requires a
> certain version of Rack. Sometimes even an older one than the current.
>
> If in doubt just run:
>
> sudo gem install rails
Hi,
Ading
config.autoload_paths += %W(#{config.root}/lib)
to my application file solved it :)
Thank you so much
On Jul 27, 5:59 am, stephenjamesmurdoch
wrote:
> Hi Nicolas, i think I've fixed the problem
>
> add the following to your application.rb file:
>
> # Custom directories with c
RubyonRails_newbie wrote:
>
> Any ideas on how to get started?
>
So, suppose you have some ratings on 10 different snowboards, each with
an 'appropriateness' score for some dimension of a snowboards attributes
(good for tricks, overall speed, degree of control, length, cost - I
don't know wha
> Hey, one other bit to that answer. MyISAM locks the whole *table*. I
> believe SQLite locks the whole *database*.
Indeed, you're right. I'll stick to PostgreSQL then.
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Rub
Hi all,
When I deploy my rails apps in production, it will barf out an error
message if my controller does not have any helper. But this does not
happen in development environment. Is there something that I can
configure through rails so production does not ask for helpers for
every controller?
T
Juan Pablo Genovese wrote:
> Buy "The RSpec Book" from Pragmatic. It's outstanding, and will give you
> extremely useful insight on TDD and BDD.
Take this really simple example of a spec (test) from "The RSpec Book."
greeter_spec.rb
describe "RSpec Greeter" do
it "
Hi Tino,
allright, hope you finally succeeded in what you wanted to do :)
I wrote you a personnal mail few days ago, about some of your
questions, but never had a reply from you.
hence I wonder if you ever received it ?
cheers,
Jérôme
On 27 juil, 10:22, tinoD wrote:
> Hi Jerome,
>
> Thank you
hari bhat wrote:
> I want to know more about callbacks in
> rails,i am not getting in application when have to use?.
>
> I know it acts like triggers .Please explain me with examples.
I assume you are referring to the ActiveRecord callbacks like
before_save, after_save,
Well, for starters, that is why MySQL has two modes. MyISAM is only for
very special cases and it is not the Rails default for MySQL.
Also, MyISAM locks a table, SQLite locks the whole file (hence, the
whole database).
InnoDB is the way to go if you'll use MySQL.
Postgre is another fantastic cho
Pål Bergström wrote:
> Does Rack come with Rails or do I need to install the gem?
Rack is a dependency of Rails so it will get installed when you install
the Rails gems. Also keep in mind certain versions of Rails requires a
certain version of Rack. Sometimes even an older one than the current.
Fernando Perez wrote:
> Juan Pablo Genovese wrote:
>> But... with SQLite you have poor support for concurrency, it's no
>> scalable, you can't secure it more than set permissions in your
>> directory, and since it is text-based, content is almost available to
>> anyone (by default).
>
> I just rem
Fernando Perez wrote:
> Juan Pablo Genovese wrote:
>> But... with SQLite you have poor support for concurrency, it's no
>> scalable, you can't secure it more than set permissions in your
>> directory, and since it is text-based, content is almost available to
>> anyone (by default).
>
> I just rem
Never mind. It appears active scaffold is actually messing this up. In
a newly created project without active scaffold it works just fine.
On Jul 27, 7:11 am, joep wrote:
> Hi all,
>
> I have a collection which I render via
>
> <%= render :partial => 'comment', :collection => @results %>
>
> This
Hi all,
I have a collection which I render via
<%= render :partial => 'comment', :collection => @results %>
This works exactly as I expect it to.
However, when I change it to
<%= render :partial => @results %>
or
<%= render @results %>
both of which the documentation describe as 'short hand
Juan Pablo Genovese wrote:
> But... with SQLite you have poor support for concurrency, it's no
> scalable, you can't secure it more than set permissions in your
> directory, and since it is text-based, content is almost available to
> anyone (by default).
I just remembered that MySQL uses MyISAM t
Does Rack come with Rails or do I need to install the gem?
--
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 f
Buy "The RSpec Book" from Pragmatic. It's outstanding, and will give you
extremely useful insight on TDD and BDD.
Cheers!!
debadatta wrote:
Hi all,
I am a newbie in rails. I have done some small applications in
rails but can't know how to make TDD and BDD in RSpec and other
tools. I have
Tom Mac wrote:
> Hi
> Please guide me to upgrade my rails application which is 2.3.5 version
> to 2.3.8 step by step.
sudo gem update
I don't remember any bad issue I fell into.
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google
>Hi all,
>I am a newbie in rails. I have done some small applications in
>rails but can't know how to make TDD and BDD in RSpec and other
>tools. I have tried by reading the rpesc tutorial from rspec.info
>website, But can't understand where to start coding and run for Red,
>Green behaviour of
On Jul 27, 11:59 am, debadatta wrote:
> Hi all,
> I am a newbie in rails. I have done some small applications in
> rails but can't know how to make TDD and BDD in RSpec and other
> tools. I have tried by reading the rpesc tutorial from rspec.info
> website, But can't understand where to sta
Hi all,
I am a newbie in rails. I have done some small applications in
rails but can't know how to make TDD and BDD in RSpec and other
tools. I have tried by reading the rpesc tutorial from rspec.info
website, But can't understand where to start coding and run for Red,
Green behaviour of code.
hey, never noticed this reply~ I ended up installing the
prototype_legacy helper plugin and good old link_to_function to fix
the problem but I really do prefer your suggestion so I will give that
a go - thanks a lot. steve
On Jul 16, 2:56 pm, Peter De Berdt wrote:
> Another option is to use the
Sorry, no idea.
(just to let you know that you're not being ignored it's just likely that
no-one has an answer for you, this generally works fine for me).
--
Andy Jeffries
http://andyjeffries.co.uk/ #rubyonrails #mysql #jquery
Registered address: 64 Sish Lane, Stevenage, Herts, SG1 3LS
Comp
In Rails 3 the rails/init.rb in gems is not automatically executed
anymore (see
https://rails.lighthouseapp.com/projects/8994/tickets/3745-railsinitrb-is-not-being-called-anymore).
As I see there a now two options:
1. Put scripts in config/initializers.
2. Create a lib/my_gem_name.rb
The second a
pepe wrote:
> Maybe adding 2 integer columns to your Posts table to count the hits?
>
> When somebody rates the Post you just add 1 to whichever column you
> need. Then it would be a simple matter of sorting your posts in
> ascending/descending sequence by the column you want to work with.
>
> I
Hi Nicolas, i think I've fixed the problem
add the following to your application.rb file:
# Custom directories with classes and modules you want to be
autoloadable.
config.autoload_paths += %W(#{config.root}/lib)
This code is generated when you create a brand new rails3rc app but
not
Hi
Please guide me to upgrade my rails application which is 2.3.5 version
to 2.3.8 step by step.
Thanks for your help
Tom
--
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,
Maybe adding 2 integer columns to your Posts table to count the hits?
When somebody rates the Post you just add 1 to whichever column you
need. Then it would be a simple matter of sorting your posts in
ascending/descending sequence by the column you want to work with.
I would add indexes by the c
Greg Donald wrote:
> I would just add the functionality to ActiveRecord:
Where does the unique aes key comes in, the user cookie?
--
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
I upgraded my rails 3 version (now using bundler-1.0.0.rc.1
but bundle install in my test_app raises an error :
bundle install
Fetching source index for http://rubygems.org/
Using rake (0.8.7)
...
Using railties (3.0.0.rc)
Using rails (3.0.0.rc)
Updating .gem files in vendor/cache
/Users/yves/.rvm
Hi Jerome,
Thank you for replying :)
On Jul 26, 9:34 pm, Jerome Fillioux wrote:
> Hi Tino,
>
> I haven't had the time to digg into this for now, but i wonder :
>
> why not using the virtualbox "shared folders" ?
> is an easy way to gain access of the underlying host OS from the
> virtual os, inc
Steve Murdoch wrote:
> sam problem here :(
>
> anyone know?
>
> I get:
>
> uninitialized constant ApplicationController::Authentication
>
> Obviously I could just move the methods from my lib/authentication.rb
> file into application_controller.rb but I'd prefer to see if there's
> another wa
sam problem here :(
anyone know?
I get:
uninitialized constant ApplicationController::Authentication
Obviously I could just move the methods from my lib/authentication.rb
file into application_controller.rb but I'd prefer to see if there's
another way first..
On Jul 27, 9:03 am, Nicolas Bl
In Rails 3b4 my ruby files in the lib directory of my application were
automaticaly loaded/required.
In Rails 3rc1, there are not anymore. Is this normal?
Where is the commit that changed this?
What is the best prefered way to load the files in "lib"?
Thanks for your answers.
Nicolas.
--
Poste
Hi
I have two tables: users and tickets. A user has many tickets which is
defined in the model. I want to order the users based on the number of
tickets they have. What is the easiest way to do it in Rails without
writing to many SQL statements.
--
You received this message because you are subscr
Could do all sorts of even more fun things with that too.
map.resources :styles, :has_many => [:beers]
map.resources :styles, :has_many => [:breweries]
map.resources :breweries, :has_many => [:styles]
Depending on how the user wants to go through (and the design of the
backend)...
On Jul 25, 12:
Could do all sorts of even more fun things with that too.
map.resources :styles, :has_many => [:beers]
map.resources :styles, :has_many => [:breweries]
map.resources :breweries, :has_many => [:styles]
Depending on how the user wants to go through (and the design of the
backend)...
On Jul 25, 12:
Could do all sorts of even more fun things with that too.
map.resources :styles, :has_many => [:beers]
map.resources :styles, :has_many => [:breweries]
map.resources :breweries, :has_many => [:styles]
Depending on how the user wants to go through (and the design of the
backend)...
On Jul 25, 12:
Dave Aronson wrote:
> On Sat, Jul 24, 2010 at 13:23, Greg Ma wrote:
>
>> I have two models, Post and Rate. You can rate each post with "good" or
>> "bad".
>> I would like to create a named_scope to get the best posts.
>> How can I do that?
>
> First you need to define "best". What is the overal
Hi Tino,
I haven't had the time to digg into this for now, but i wonder :
why not using the virtualbox "shared folders" ?
is an easy way to gain access of the underlying host OS from the
virtual os, including extra disk space.
you can find more informations about the shared folders here :
https:
On Jul 26, 11:27 pm, Pål Bergström wrote:
> Greg Donald wrote:
> > 2010/7/26 P l Bergstr m :
> > params is a type of hash, and Hash has merge. So you can add stuff to
> > the params before passing it to the model, something like:
>
> > params.merge( :my_cookie => cookies[:my_cookie] )
>
> That
88 matches
Mail list logo