Tom Shealy wrote:
Hello,
I was wondering if there's an easy way to make ActionController render a
response in an asynchronous background process.
I have a large object graph which takes over a minute to serialize in
amf:
render :amf = myData
I'd like to render() the amf
You could union it in the sql or do this in ruby:
@access_senders GroupUser.new(:user_id = 3)
Cheers
Luke
--
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
Hiya Graham,
It depends on your setup really but I would say in this case you would
want another controller.
If you've put all the shared html into partials then on the new index
page you would just need to do a few %= render :partial =
'PARTIAL_NAME'% to pull in the html you need.
On 20 March 2010 18:52, Joshua Martin josmar52...@gmail.com wrote:
The text_field should be disabled so that the user can't put it a
random date without regard to the terms or invoice date.
So what stops them writing their own form and posting whatever value
they want? Or using some DOM
I have some code that works when logged_in but not when not logged_in. The
switch_theme action just changes the variable controlling the CSS stylesheet
and does a 'redirect_to :back'. But no other action is called. The log looks
like below. Ring any bells?
TIA,
Jeffrey
Non-working:
On 21 March 2010 00:48, Mike Montagne li...@ruby-forum.com wrote:
Abraham Tio wrote:
cd /usr/local/lib/ruby/gems/1.8/gems/mysql-2.7
gem install mysql --
--with-mysql-config=/usr/local/mysql/bin/mysql_config
Greg Donald
http://destiney.com/
YUP. this works.
newbie question...
I was able
On 21 March 2010 04:07, RichardOnRails
richarddummymailbox58...@uscomputergurus.com wrote:
Hi,
I've got the following code in my attempt to provide the subject
functionality, lines 20-29 in view:
%= image_tag DownArrow.jpg options =
{ onclick=page[vendor_droplist].show } %
I don't know
On 21 March 2010 05:02, RichardOnRails
richarddummymailbox58...@uscomputergurus.com wrote:
OK, I got rid of all the syntax errors.
The vendor_drop list is now hidden on startup of the view
I switched from an image to a button
However, the drop list does not get displayed when the ShowList
On 20 March 2010 09:57, Newb Newb li...@ruby-forum.com wrote:
HEllo all,
Kindly look into the below query
@access_senders = GroupUser.find_by_sql select distinct user_id from
group_users where group_id in (SELECT group_id FROM group_users where
user_id=2)
when i inspect the
Hail Caesars!
I have the following text entry field in my view: %=
text_field :order, :company_name %
However, company_name doesn't really reside in the orders table. It
resides in the company table, which belongs to order, as follows:
Order.company.company_name. This is where my controller
In a Rails 2.x validation to check if the name of some model is unique
within a some category, I would use:
`validates_uniqueness_of :name, :scope = :category_id`
In Rails 3, this is replaced with:
`validates :name, :uniqueness = true`
However, I can't seem to find a method of defining the
I have a Shop model that has_many Zones (a Zone assigns different
pricing to products). I want to save a default Zone for a Shop. This
is what I have in my Shop class:
has_one :default_zone, :class_name = Zone
After that, however, I am a bit lost. I know I can manually set
shop.default_zone_id
Basically I've been creating various RoR (ruby on rails) applications
and I cant figure out how to add properties to an already existing
scaffold; I have ended up destroying and messing up two projects that
I've worked hard on so far in trying to do this and realised I need
some help trying to
Hi Colin,
Your check the HTML tip is *great* ... it's now in my debugging
arsenal.
comma missing
That was a tip on my img-base code. I'll get back to that because I
like the down-arrow image better that ShowList button version, which
is close to working.
My last next-to-last problem in this
Don't you just use the scaffold, as a bases, and the create the rest
manual?
What is your exact problem:
What have you done?
What are you missing/trying to do?
Give concrete examples.
/SG
On Mar 21, 9:06 am, yout...@dev-hq.co.uk wrote:
Basically I've been creating various RoR (ruby on rails)
For example if I created a forum with RoR and decided to have a forum,
thread, and post scaffold, and they each has their own properties;
Lets say the forum scaffold was made with these parameters forum
name:string number:integer. However if I wanted to add another
property to the forum scaffold
On 21 March 2010 12:02, yout...@dev-hq.co.uk wrote:
For example if I created a forum with RoR and decided to have a forum,
thread, and post scaffold, and they each has their own properties;
rake aborted!
An error has occurred, this and all later migrations canceled:
You've got some
Aha, thanks! ill look into this (I really dont know any of the
terminology, when I created the stuff I saw the word scaffold and
assumed this was what to call it :P)
If I have any further problems ill ask.
Thanks,
Joe
On Mar 21, 1:02 pm, Michael Pavling pavl...@gmail.com wrote:
On 21 March
Aha, thanks! ill look into this (I really dont know any of the
terminology, when I created the stuff I saw the word scaffold and
assumed this was what to call it :P)
If I have any further problems ill ask.
Thanks,
Joe
On Mar 21, 1:02 pm, Michael Pavling pavl...@gmail.com wrote:
On 21 March
Ok, I seem to have a problem already.
So first of all with these things, can I just change it in db/migrate/
WhateverFile.rb ?
Then when I have changed it how do I put these changes into action?
Also I cant seem to find how this could help me solve the error:
rake aborted!
An error has
Ok, I seem to have a problem already.
So first of all with these things, can I just change it in db/migrate/
WhateverFile.rb ?
Then when I have changed it how do I put these changes into action?
Also I cant seem to find how this could help me solve the error:
rake aborted!
An error has
Ok, I seem to have a problem already.
So first of all with these things, can I just change it in db/migrate/
WhateverFile.rb ?
Then when I have changed it how do I put these changes into action?
Also I cant seem to find how this could help me solve the error:
rake aborted!
An error has
Ok, I seem to have a problem already.
So first of all with these things, can I just change it in db/migrate/
WhateverFile.rb ?
Then when I have changed it how do I put these changes into action?
Also I cant seem to find how this could help me solve the error:
rake aborted!
An error has
On 21 March 2010 10:49, RichardOnRails
richarddummymailbox58...@uscomputergurus.com wrote:
Hi Colin,
Your check the HTML tip is *great* ... it's now in my debugging
arsenal.
Another tip is to install the Html Validator add-on to Firefox and it
will automatically validate your pages as you
On 21 March 2010 13:40, yout...@dev-hq.co.uk wrote:
Ok, I seem to have a problem already.
So first of all with these things, can I just change it in db/migrate/
WhateverFile.rb ?
Then when I have changed it how do I put these changes into action?
I suggest you have a look at the rails
If you read carefully http://guides.rubyonrails.org/getting_started.html
you can find
that in your routes.rb file have to be following lines
map.connect ':controller/:action/:id'
map.connect ':controller/:action/:id.:format'
I also new in RoR and I don't know why you wrote map.connect 'home/
I have several questions and i need clear understanding on how i should
approach them, my target is for creating something called fakebook,
facebooks copy but not going live at all (uni project).
Security Question
This is the code that helps me protect my user/index..
private
def protect
On Sun, Mar 21, 2010 at 12:25 PM, Jagmit Gabba li...@ruby-forum.com wrote:
I have several questions and i need clear understanding on how i should
approach them, my target is for creating something called fakebook,
facebooks copy but not going live at all (uni project).
Security Question
And remember to use
http://railscasts.com/
Great for getting started.
/SG
On Mar 21, 3:26 pm, Colin Law clan...@googlemail.com wrote:
On 21 March 2010 13:40, yout...@dev-hq.co.uk wrote:
Ok, I seem to have a problem already.
So first of all with these things, can I just change it in
Leonardo Mateo wrote:
On Sun, Mar 21, 2010 at 12:25 PM, Jagmit Gabba li...@ruby-forum.com
wrote:
� � �flash[:notice] = Please Login to view this page, or Register if
flash message is displayed.
I'd strongly suggest you to take a look at Authlogic[1] gem. Even when
this is a very
Logging out feature,
Code:
def logout
@title = Login - Books
session[:user_id] != nil
flash[:notice] = You have sucessfully been logged out !
redirect_to :controller = :books, :action = :index
end
end
^^when this is run, it logs the user out (nill) and displays you have
Hello,
I'm working with probability and Ruby doesn't really does as I want.
Just to make it easier to understand I'll focus on the problem.
I have some event that should occur in 20% of all events. I thought I'd
make it easy by just using rand like following:
num = 20 - rand(100)
if(num 0)
Quoting Jagmit Gabba li...@ruby-forum.com:
Logging out feature,
Code:
def logout
@title = Login - Books
session[:user_id] != nil
flash[:notice] = You have sucessfully been logged out !
redirect_to :controller = :books, :action = :index
end
end
^^when this is
Ok, So I figure I have to roll the database back and then migrate it
again.
However it just isnt doing anything when I call rake db:rollback, or
even specify a STEP:
rake db:rollback STEP=4
(in C:/Users/user/Documents/Aptana Studio Workspace/ProductCatalog)
rake db:rollback STEP=10
(in
Ok, So I figure I have to roll the database back and then migrate it
again.
However it just isnt doing anything when I call rake db:rollback, or
even specify a STEP:
rake db:rollback STEP=4
(in C:/Users/user/Documents/Aptana Studio Workspace/ProductCatalog)
rake db:rollback STEP=10
(in
NEVER MIND. I was being an idiot. I just deleted the old migration
file that was causing the problems; and then created a new migration
file to get the new stuff in..
Thanks Guys,
-Joe
On Mar 21, 4:25 pm, yout...@dev-hq.co.uk wrote:
Ok, So I figure I have to roll the database back and then
Jeffrey L. Taylor wrote:
Quoting Jagmit Gabba li...@ruby-forum.com:
end
flash[:notice] = You have sucessfully been logged out
#...@user.screen_name} !
redirect_to :controller = :books, :action = :index
end
end
^^what i was hoping this would do is to display the users name as
Hi all!
I'm playing with Rails 3, and on one of my controllers I have the
following update method defined:
def update
@category = @user.categories.find(params[:id])
@category.update_attributes(params[:ecategory])
@category.save
respond_with @category
end
I'm using Jquery to
On 21 March 2010 15:25, Jagmit Gabba li...@ruby-forum.com wrote:
I have several questions and i need clear understanding on how i should
approach them, my target is for creating something called fakebook,
facebooks copy but not going live at all (uni project).
Security Question
This is the
The code snippet seems OK to me, although the code you have in the if block
will happen 80% not 20% of the time, and it could be made a bit slimmer.
But you say it happens less than 20%?
Tried this on by Ubuntu box with Ruby 1.8.7:
irb(main):021:0 counter = 0
= 0
irb(main):022:0
Quoting Jagmit Gabba li...@ruby-forum.com:
Jeffrey L. Taylor wrote:
Quoting Jagmit Gabba li...@ruby-forum.com:
end
flash[:notice] = You have sucessfully been logged out
#...@user.screen_name} !
redirect_to :controller = :books, :action = :index
end
end
^^what i was
On 21 March 2010 15:59, Jagmit Gabba li...@ruby-forum.com wrote:
Logging out feature,
Code:
def logout
�...@title = Login - Books
session[:user_id] != nil
Do you mean
session[:user_id] = nil
Colin
flash[:notice] = You have sucessfully been logged out !
redirect_to
Quoting Heinz Strunk li...@ruby-forum.com:
Hello,
I'm working with probability and Ruby doesn't really does as I want.
Just to make it easier to understand I'll focus on the problem.
I have some event that should occur in 20% of all events. I thought I'd
make it easy by just using rand
Quoting Jeffrey L. Taylor r...@abluz.dyndns.org:
[snip]
I dumped the first line into irb and tried it. It looked like do_stuff
wouldn't be called often enough, so I actually counted the occurrences and
crunched the numbers. They were within a reasonable distance of 1 in 5. I
suggest
Colin Law wrote:
On 21 March 2010 15:25, Jagmit Gabba li...@ruby-forum.com wrote:
� � �flash[:notice] = Please Login to view this page, or Register if
flash message is displayed.
When the user is logged in, i want it to redirect the user/register
and user/login to the user/index, and if they
Thank you very much Jeffrey and Colin...
:)
It worked perfectly and change the != to =
--
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
The Sun, 21 Mar 2010 17:12:02 +0100,
Heinz Strunk li...@ruby-forum.com wrote:
Hello,
I'm working with probability and Ruby doesn't really does as I want.
Just to make it easier to understand I'll focus on the problem.
I have some event that should occur in 20% of all events. I thought
On Sun, Mar 21, 2010 at 9:44 AM, Fabio Kreusch fabi...@gmail.com wrote:
Hi all!
I'm playing with Rails 3, and on one of my controllers I have the
following update method defined:
def update
@category = @user.categories.find(params[:id])
Colin Law wrote:
ri and rdoc are just for documentation of the gem. Google them to
find details. Not having them will not affect the operation of the
gem.
Colin
Thanks Colin. I quickly found that out. I've posted instructions for
resolving this issue at MySQL:
Hi everyone, i followed colins example and it worked perfectly but now i
get this error
ActionController::DoubleRenderError in UserController#login
Render and/or redirect were called multiple times in this action. Please
note that you may only call render OR redirect, and at most once per
Thanks Mark and Max
On Mar 20, 10:40 pm, Mark McConachie m...@markmcconachie.com wrote:
Great blog, I have forwarded this to some beginners I know.
On Mar 19, 3:52 pm, pankaj pankajbhage...@gmail.com wrote:
Hello Everyone,
I have started my blog athttp://railsguru.org.
Besides other
On Mar 21, 7:00 pm, Tiger Big one li...@ruby-forum.com wrote:
Hi everyone, i followed colins example and it worked perfectly but now i
get this error
ActionController::DoubleRenderError in UserController#login
Render and/or redirect were called multiple times in this action. Please
note
Frederick Cheung wrote:
On Mar 21, 7:00�pm, Tiger Big one li...@ruby-forum.com wrote:
In the case where the request is a post request and if the user is
logged in successfully you are calling redirect_to :action = 'index'
twice
Fred
I wrote the same code (exactly the same code)...twice
Hi guys (and gals),
I have the most strange issue that I just cannot figure out. It
doesn't make sense at all why it's happening, and had a fellow Rails
developer friend of mine from the UK look at it with me last night,
and still couldn't figure it out.
Ok, so I have a helpdesk ticketing system
On 21 March 2010 20:03, command0 justinbrinkerh...@gmail.com wrote:
The problem I am having, is when I try to create a new ticket, I get
the error:
NoMethodError (undefined method `customer' for nil:NilClass):
app/models/ticket_mailer.rb:7:in `newticket'
Maybe I'm stating the obvious, but it seems to suggest that you have
simply
not backup/copied the public directory, and so your app is picking up
public/index.html. If public/index.html exists, just delete it.
On Mar 20, 1:33 am, nshenry03 nshenr...@gmail.com wrote:
I am simply trying to backup
Luke Pearce wrote:
Hiya Graham,
It depends on your setup really but I would say in this case you would
want another controller.
If you've put all the shared html into partials then on the new index
page you would just need to do a few %= render :partial =
'PARTIAL_NAME'% to pull in
LOL yeah, I was so tired when I was working on this earlier this
morning, I just totally overlooked that.
When I change the assignment, I get the Need controller and action!
error.
In the View, here is the whole verbage it spits out:
ActionController::RoutingError in Tickets#create
Showing
On 21 March 2010 21:01, command0 justinbrinkerh...@gmail.com wrote:
5: You can view your ticket at %= link_to @ticket %.
Do you have map_resources :tickets in your routes.rb file?
--
You received this message because you are subscribed to the Google Groups Ruby
on Rails: Talk group.
To post
I have:
map.resources :tickets, :has_many = [:notes, :comments]
In routes.rb.
On Mar 21, 3:20 pm, Michael Pavling pavl...@gmail.com wrote:
On 21 March 2010 21:01, command0 justinbrinkerh...@gmail.com wrote:
5: You can view your ticket at %= link_to @ticket %.
Do you have map_resources
On 21 March 2010 21:29, command0 justinbrinkerh...@gmail.com wrote:
I have:
map.resources :tickets, :has_many = [:notes, :comments]
In routes.rb.
5: You can view your ticket at %= link_to @ticket %.
Okay,
So when we get to line 5 of app/views/ticket_mailer/newticket.erb,
you're passing
thanks.
Guido
On 20 Mar, 00:47, Fernando Perez li...@ruby-forum.com wrote:
Someone can help me?
Just grab it from github and drop it in vendor/plugins, there is no
special install step to run.
--
Posted viahttp://www.ruby-forum.com/.
--
You received this message because you are
Thanks Conrad, I have removed the save call from the code, but it
continues to return an empty JSON on success case.
Any more clues?
On Mar 21, 3:37 pm, Conrad Taylor conra...@gmail.com wrote:
On Sun, Mar 21, 2010 at 9:44 AM, Fabio Kreusch fabi...@gmail.com wrote:
Hi all!
I'm playing with
Nikhil Gupte wrote:
Jean,
Best is to install macports, if you aren't already using it.
To re-compile ruby, run:
sudo port install ruby
I was able to get mysql gem to install on OSX Leopard without warnings
with the --no-rdoc and --no-ri switches; archflags likewise eliminated
the
José Luis Romero wrote:
Done! Same results...
uninitialized constant MysqlCompat::MysqlRes
Thanks... Any other approach?
Try setting ARCHflags.
OSX Snow Leopard will return the same results you're getting if you
don't set the ARCHflags. You'll have to look them up for your system,
but
On Sun, Mar 21, 2010 at 5:45 PM, Mike Montagne li...@ruby-forum.com wrote:
iMacMike:pfmpe mikemontagne$ rake db:migrate --trace
Unknown database 'pfmpe_development'
database.yml indicates that this is supposed to be the development
database. But no such file exists in my project directory.
On Sun, Mar 21, 2010 at 4:41 PM, Fabio Kreusch fabi...@gmail.com wrote:
Thanks Conrad, I have removed the save call from the code, but it
continues to return an empty JSON on success case.
Any more clues?
Fabio, what happens in the Rails 3 console? For example, you can do the
following in
Hi, all.
With unbelievable difficulty, I have the mysql gem installed without
warnings with the following components:
OSX Leopard 10.6.2
ruby 1.8.7 (2008-08-11 patchlevel 72) [universal-darwin10.0]
Rails 2.3.5
mysql (2.8.1) [gem version]
MySQL Server 5.1.44
I even rebuilt my whole project a few
Hi Conrad,
I have tried Rails console, and while trying to convert to json the
results were the expected.
This is the Jquery code used on my ajax form:
$('#category_form').submit(function() {
var form = $(this);
$.ajax({
url: form.attr('action'),
type: 'POST',
data:
Gotcha! Perfect. Thank you Jeffrey.
I got it to work with the following.
In my view:
%= link_to_function truncate(link.name, 60),
clickThru('#{link.link}','#{link[:id]}', 'votes'),
:title = link.name, :href = link.link %
In my application.js
function clickThru(url, id, verb) {
new
On Sun, Mar 21, 2010 at 6:25 PM, Mike Montagne li...@ruby-forum.com wrote:
Does anybody have any idea what I still have fudged up here? Why isn't
the database being created? Are we supposed to manually create our
database schema when working with the MySQL gem?
You have to create your
The value of @ticket is represted as an array of all the attributes of
the ticket itself.
I just realized that. I had to change my link_to arguments just
slightly...
On Mar 21, 3:38 pm, Michael Pavling pavl...@gmail.com wrote:
On 21 March 2010 21:29, command0 justinbrinkerh...@gmail.com wrote:
Sorry for this. It's my first go-around with RoR/MySQL. Got it:
rake db:create RAILS_ENV='development'
Then:
rake db:migrate --trace
--
Still, if anybody has any general pointers about how to go about
developing MySQL locally... much appreciated.
Regards,
mike
--
Posted via
I am using restful authentication and was wondering if anyone has had
any experience with sub accounts. Basically, I want a user to have the
ability to add another user(s) to his/her account. So if user A
creates an account I would like them to have the ability to add new
users to their account -
On Sun, Mar 21, 2010 at 7:24 PM, Mike Montagne li...@ruby-forum.com wrote:
What's the basic procedure for local development and deployment of the
tables? Do you suffer the database-agnostic field definitions of the
local development environment (db:create and db:migrate); or, wanting to
test
Turns out this was caused because my controller was singular
(ProspectController) instead of plural (ProspectsController).
On Mar 20, 12:42 pm, rjunee r...@junee.org wrote:
I use:
% form_for @prospect do |f| %
which generates:
form action=/prospects class=new_prospect id=new_prospect
Hi everyone,
I am trying to set up a controller and a view manually, without the
aid of scaffolding (though I am using a scaffolded model as reference).
I have set up my controller like this:
class RecetasController ApplicationController
def index
respond_to do |format|
Hi
Lots of thanks for all your reply. What I am finally doing is
following. (Is it you people suggested?). I have still problem in
creating the view for adding a staff. Please correct me if what I am
doing is wrong way.
users
-
name
email
phone etc
staffs
--
city
Hassan Schroeder wrote:
On Sun, Mar 21, 2010 at 7:24 PM, Mike Montagne li...@ruby-forum.com
wrote:
What's the basic procedure for local development and deployment of the
tables? Do you suffer the database-agnostic field definitions of the
local development environment (db:create and
On Sun, Mar 21, 2010 at 6:27 PM, Fabio Kreusch fabi...@gmail.com wrote:
Hi Conrad,
I have tried Rails console, and while trying to convert to json the
results were the expected.
This is the Jquery code used on my ajax form:
$('#category_form').submit(function() {
var form = $(this);
tuti plain wrote:
Hi everyone,
I am trying to set up a controller and a view manually, without the
aid of scaffolding (though I am using a scaffolded model as reference).
I have set up my controller like this:
class RecetasController ApplicationController
def index
respond_to
mlittle wrote:
I am using restful authentication and was wondering if anyone has had
any experience with sub accounts. Basically, I want a user to have the
ability to add another user(s) to his/her account. So if user A
creates an account I would like them to have the ability to add new
users
On Mar 21, 10:33 pm, Loganathan Ganesan li...@ruby-forum.com wrote:
mlittle wrote:
I am using restful authentication and was wondering if anyone has had
any experience with sub accounts. Basically, I want a user to have the
ability to add another user(s) to his/her account. So if user A
mlittle wrote:
On Mar 21, 10:33�pm, Loganathan Ganesan li...@ruby-forum.com wrote:
I suggest the following database model:
UserID
In the models
Users � = has_many :sub_users
sub_users = belongs_to :User
so, you should delete first sub_users records, then Users table records.
--
Posted
On Sun, Mar 21, 2010 at 9:43 PM, Mike Montagne li...@ruby-forum.com wrote:
These are regular concerns for anyone with a background in RDBMS, just
now getting their feet wet in RoR.
Let it go, at least for a short vacation :-)
Do a quick search on premature optimization.
Consider that the
On Mar 21, 10:46 pm, Loganathan Ganesan li...@ruby-forum.com wrote:
mlittle wrote:
On Mar 21, 10:33 pm, Loganathan Ganesan li...@ruby-forum.com wrote:
I suggest the following database model:
UserID
In the models
Users = has_many :sub_users
sub_users = belongs_to :User
so, you
86 matches
Mail list logo