Not 100% sure I understand what you're trying to do, but here are a couple
of items that strike me based on the code posted.
First, your model method has two return statements. I don't know whether
Ruby will throw up some kind of parsing error to that, but certainly the
second of those will never
vimal wrote:
> Hi,
>
> Thanks for pointing it out. I'm sorry, sometimes i ask some stupid
> questions. since my english is weak . Forgive me :)
>
> My answer is yes, the session prevails though i kill the server.
> How can i overcome this by clearing the session information each
> time the
Hi,
Thanks for pointing it out. I'm sorry, sometimes i ask some stupid
questions. since my english is weak . Forgive me :)
My answer is yes, the session prevails though i kill the server.
How can i overcome this by clearing the session information each
time the rails server is killed.
Tha
vimal wrote:
> Hi,
>
> I am maintaining sessions for storing user informations.
> When i logout i clear the session using reset_session.
>
> Will the session be available if i kill the rails server?
>
Try it and let us know.
--
Posted via http://www.ruby-forum.com/.
--~--~---
Hi,
I am maintaining sessions for storing user informations.
When i logout i clear the session using reset_session.
Will the session be available if i kill the rails server?
If yes, Why does this happen and how can i overcome this by
resetting the session?
Please give me so
You can do this in the controller, but I'd advise against this.
Why? Business logic is best located and/or managed by the model. The
easiest way to do this would be to modify the database column to set a
default value, which Active Record will read when it looks at the
table structure and use thi
this worked great, thanks
--b
On Apr 22, 8:09 pm, Franco Catena wrote:
> You can do this in the controller:
>
> @foo = Foo.new(:parameter_name => true)
>
> And then this in the view:
>
> form_for(@foo) do |f|
>
> f.check_box :parameter_name
>
> Regards.
>
> Franco Catena.
>
> On Apr 22, 5:24 pm
So in the recent doubleshot http://afreshcup.com/2009/04/24/double-shot-438/
there is the comment "Tips for writing your own Rails engine I’d
wait for Rails 3 if I could myself."
What is planned for Rails3 that is preferable over Engines? Would not
moving to Engines now make it easier to ad
Guys thanks so much for all your help. The sql is working great.
I really do appreciate your prompt replies.
Thanks, so much once again.
--
Posted via http://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the
Solved the problem. I was using attr_accessible and forgot to include
the date_select field in it. Stupid of me.
thanks
Frederick Cheung wrote:
> On Apr 26, 8:20�pm, Sam Ginko
> wrote:
>> I'm trying to insert the selected values of the date_select object in
>> the database but I'm getting noth
Solved the problem. I was using attr_accessible and forgot to include
the date_select field in it. Stupid of me.
James Byrne wrote:
> Sam Ginko wrote:
>> I'm trying to insert the selected values of the date_select object in
>> the database but I'm getting nothing
>>
>> controller looks like th
Sam Ginko wrote:
> I'm trying to insert the selected values of the date_select object in
> the database but I'm getting nothing
>
> controller looks like this.
> def create
> @post = Post.new(params[:post])
> if @post.save
> flash[:notice] = 'Post was successfully created.'
>
I know that
the versions of RoR after 2 want you to use the C adaptor for MySql.
Is there some reason for this other than performance? Not all of us
need the highest performance solution (or we wouldn't be using RoR) but
it is more convenient to use an adaptor bundled in with the system. Is
In case any more help is needed, what Fred is saying is that the
question mark is not going to be replaced by anything because you are
using a string and not an array for your find_by_sql. When the code
runs the question mark will stay and the SQL engine will probably
either find nothing because '
Thanks for the explanation, but I was looking more towards of why the
application works after changing that setting, which should have
nothing to do about how sessions work, which I believe to be the real
problem.
I have noticed that when auto-complete fields are used and vaulues
selected the ses
I have a child relationship that is denormalized. I want to normalize
it at the object level once it's retrieved:
class Parent
has_many :denormalized_children, :class_name=>'Child'
def children
if @normalized_children.nil?
@normalized_children = []
denormalized_children.gr
I think the guide Getting Started with Rails isn't quite complete.
Following along with your theme, you should create an action in the Post
controller called "get".
Don't worry, you are in good company with lots of other authors, who
don't consider the names they use in their code very carefully,
pepe wrote:
> Found a hack?
>
> I looked into the environments folder and compared development vs.
> production. I found this line:
>
> config.action_controller.consider_all_requests_local = false
>
> I changed it to 'true' and the application now works. Any kind soul
> that could explain this
7stud -- wrote:
> 7stud -- wrote:
>>
>> Link.create("url" => params[:url])
>>
>> (that assumes the links table has only one field: url)
>>
>> Apparently when you assign a Link object to the variable @link, rails
>> will create a record in the database corresponding to the values in the
>> Lin
On Sun, Apr 26, 2009 at 2:34 PM, InventoryTrackers
wrote:
>
> I posted two days ago asking how this group tracks their traffic and
> received the reply "Google Analytics?"
>
> I Googled on "Rails Analytics" and have gone about 20 pages back
> without finding any explanations of how one installs a
I posted two days ago asking how this group tracks their traffic and
received the reply "Google Analytics?"
I Googled on "Rails Analytics" and have gone about 20 pages back
without finding any explanations of how one installs and implements
this into their code.
I own most Rails books and find n
It doe not insert anything into the database. I guess it's what you
describe as "save but the birthdate attribute is not set"
Frederick Cheung wrote:
> On Apr 26, 8:20�pm, Sam Ginko
> wrote:
>> I'm trying to insert the selected values of the date_select object in
>> the database but I'm gettin
On Apr 26, 4:48 pm, Darren Strom
wrote:
> Basically using
>
> and elevators.booked_date = ?, params[:booked_date] is causing only
> errors.
>
> Any advise, I truely appreciate it.
>
much like the :conditions option requires either a string, or an
array containing a string and the parameter va
On Apr 26, 8:20 pm, Sam Ginko
wrote:
> I'm trying to insert the selected values of the date_select object in
> the database but I'm getting nothing
>
[snip]
>
> Am i doing something wrong?
Not at first glance. Define nothing (date parameter is not in the
request parameters at all, object does
On Apr 26, 8:06 pm, sheru wrote:
> Hi,
> I am Sheru & am completely new for this web framework. I am really
> really enthusiastic to know the Ruby on Rails & possibly try to use
> this framework near future.
>
> But at the start up, I don't have idea on installing RoR on Windows
> XP.
>
> 1. What
I'm trying to insert the selected values of the date_select object in
the database but I'm getting nothing
controller looks like this.
def create
@post = Post.new(params[:post])
if @post.save
flash[:notice] = 'Post was successfully created.'
redirect_to :action => 'list'
e
Hi,
I am Sheru & am completely new for this web framework. I am really
really enthusiastic to know the Ruby on Rails & possibly try to use
this framework near future.
But at the start up, I don't have idea on installing RoR on Windows
XP.
1. What is the sequential intalling components of RoR?
2.
On Apr 26, 12:25 am, serenobs wrote:
.
.
>
> There is a db file at db folder named development.sqlite3
> what's wrong with me?
> Somebody help me, please.
>
Did your migration complete successfully? i.e. does the table posts
exist in your database?
Does your database.yml file point to your db fil
i had the same problem.Your post solved the problem.
Thanks guy.
http://www.netsyscom.biz
--~--~-~--~~~---~--~~
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
Are you saying that after the update_attribute the password field is also
changed? If so do you have some sort of filter that might be running and
changing it? Possibly you could put debugger traps at each point you change
the password and check it is not getting there. Also have a look in the l
Il giorno 26/apr/09, alle ore 17:53, Matt Jones ha scritto:
> I know that you said not to discuss it, but seriously, why on earth
> would this be a requirement?
You're right, but it's a university project.
--~--~-~--~~~---~--~~
You received this message because
I ended up kinda working it out. I now just reset the password and email
the link to the user. Not 100% ideal but it works!
--
Posted via http://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
This does the trick:
<%= select_tag :role, options_for_select(Project::COMPANY_ROLES +
['Other...'], @relationship.role), :class => 'selectInput
hasOtherValue' %>
On Apr 25, 10:40 pm, Tom Milewski wrote:
> Hello,
>
> I have the following code:
>
> <%= select_tag :role, options_for_select(Proje
On Apr 24, 4:39 am, Carmine Paolino wrote:
> 2. The philosophy behind this project is "Use the XML technologies as
> much as possible", so a major requirement is to not use a db _at all_
> (no berkeley db xml, please).
>
I know that you said not to discuss it, but seriously, why on earth
wou
I'm having some difficulty getting find_by_sql to work.
This code below works perfect:
@available = Elevator.find_by_sql("select name from elevator_timeslots
WHERE NOT EXISTS(select elevator_timeslot_id from elevators where
elevators.elevator_timeslot_id = elevator_timeslots.id)")
Now I'm tryin
The containing module for the ERB code isn't the model or the
controller, it's part of ActionView::Base.
Try explicitly qualifying the constant as Client::TITLES.
Also, module names are not traditionally spelled in all-caps, but
that's just a style thing.
--Matt Jones
On Apr 24, 5:52 pm, Coond
Hi,
In my little blog engine, display a sidebar that has the 10 latest
images I have uploaded, it's a list formatted with its Textile html
equivalent.
So I'd like to make my little list draggable. That's easy, but now the
problem is that when I drop an element, it should add the test where I
dro
I am developing a small site. The login system works fine and I am using
the sha1 hashing alg to hash passwords. I have an admin side that can
enable or disable users. The problem seems to lie in the disable
(destroy) method. When I disable a user, it updates the password to a
new password so when
Of course ruby, ruby gems and sqlite3 are installed on my system
(CentOS 5.3)
#gem install sqlite3-ruby
Building native extensions. This could take a while...
Successfully installed sqlite3-ruby-1.2.4
1 gem installed
Installing ri documentation for sqlite3-ruby-1.2.4...
Installing RDoc documenta
Found! :D
Model:
# XXL name to prevent override meta-methods such as paginate_published
def self.paginate_all_published_posts(options)
self.with_published do
return self.paginate(options)
end
end
Controller:
@posts = Post.paginate_all_published_posts(options)
On Sun, Apr 26
*Smacks forehead* Thanks Colin & Frederick for the responses - it
makes sense now. I modified to use lambdas and it seems to be working
as expected:
class Event
named_scope :upcoming, lambda {
{ :conditions => ["starts_at >= ?",
Time.zone.now.beginning_of_day] }
}
end
--~--~-~-
I want to display published posts that are tagged using will_paginate.
Options include:
1. Add :conditions => { :published => true } to the find options. Does not
work because will_paginate will then return too many records.
2. Use scope_out in class Post like this:
scope_out :published, :conditi
7stud -- wrote:
>
> Link.create("url" => params[:url])
>
> (that assumes the links table has only one field: url)
>
> Apparently when you assign a Link object to the variable @link, rails
> will create a record in the database corresponding to the values in the
> Link object. If you look at
Found a hack?
I looked into the environments folder and compared development vs.
production. I found this line:
config.action_controller.consider_all_requests_local = false
I changed it to 'true' and the application now works. Any kind soul
that could explain this to me? I'm not really a Rails
Cisco Ri wrote:
> When I use <% form_for :link,
> :url => {:action => :new},
> :html => {:method => :get} do |f| %>
>
> the type http://www.gmail.com into the form and hit submit, the address
> bar changes to
> http://localhost:3000/links/new?link[notspamurl]=http%3A%2F%2F
Still trying to figure this out. Some more info:
The auto-complete field that does not work depends on the values
entered in 2 other auto-comple fields. In development the 2 fields are
being updated correctly but not when the application runs in
production mode mode.
Those values are stored in s
Samiron Rony wrote:
> Include the following CSS property for all the anchors in your project
>
> a{
>outline:none
> }
> I checked the code in firefox, chrome and IE7. Hope this will work.
> If u r using different CSS classes just make sure that any other class
> doesnt override this prop
Hello.
ruby 1.8.6 (patchlevel 111)
rails 2.3.2
Windows XP Professional
I am getting quite a weird problem. I have several auto-complete
fields in a page. When I run the code in development mode everything
works but when the application runs in production mode one and only
one of the fields does
Include the following CSS property for all the anchors in your project
a{
outline:none
}
I checked the code in firefox, chrome and IE7. Hope this will work.
If u r using different CSS classes just make sure that any other class
doesnt override this property.
Thank u
On Apr 26, 5:01 pm,
Thomas Waswasi wrote:
> I want to insert some rows into a sqlite3 database where some tables
> contain BOOLEAN columns.
>
> Some older applications accessing the same DB require boolean columns
> to be 0 and 1, whereas the default behaviour of the sqlite Adapter is
> a mapping of true/false value
Hi,
I want to insert some rows into a sqlite3 database where some tables
contain BOOLEAN columns.
Some older applications accessing the same DB require boolean columns
to be 0 and 1, whereas the default behaviour of the sqlite Adapter is
a mapping of true/false values to 't' and 'f' in the datab
M. Figueiroa wrote:
> In my case I just downloaded the sqllite3.dll from the
> http://www.sqlite.org/download.html (This is a DLL of the SQLite library
> without the TCL bindings. The only external dependency is MSVCRT.DLL.)
> and then copied it to the Windows\System32 folder. It worked.
MY P
Frederick Cheung wrote:
> On Apr 26, 7:01�am, Jay Pangmi
> wrote:
>> Hassan Schroeder wrote:
>> > On Sat, Apr 25, 2009 at 7:00 AM, Jay Pangmi
>> > wrote:
>>
>
>> ===
>> ===
>>
>> � http://www."; class = "side-link
When I use <% form_for :link,
:url => {:action => :new},
:html => {:method => :get} do |f| %>
the type http://www.gmail.com into the form and hit submit, the address
bar changes to
http://localhost:3000/links/new?link[notspamurl]=http%3A%2F%2Fwww.gmail.com&commit=Create
(
Rails 2.3.2. Yeah, I meant that is the view. The relevant actions in
the controller are:
# GET /links/new
# GET /links/new.xml
def new
@link = Link.new
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @link }
end
end
# POST /lin
Cisco Ri wrote:
>
> Right now my controller looks like:
>
> <% form_for @link, :method => :get do |f| %>
1) Controller? Isn't that a View?
2) Looking at an example in my book for form_for shows that the first
argument for form_for is a Symbol, e.g. :link.
3) You didn't specify the action(a me
I just updated my rails application from 2.2.2 to 2.3.2 and the
following message is displayed while trying to start with ./script/
server:
[code]
=> Booting Mongrel
=> Rails 2.3.2 application starting on http://0.0.0.0:3000
/opt/local/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/
active_suppor
On Apr 26, 7:01 am, Jay Pangmi
wrote:
> Hassan Schroeder wrote:
> > On Sat, Apr 25, 2009 at 7:00 AM, Jay Pangmi
> > wrote:
>
> ===
> ===
>
> http://www."; class = "side-link">Home
> <%= link_to "Products", :a
Hello everyone,
Please help, need 2 developers to switch my website from php to RonR.
Please give quote
http://www.nhadatvina.vn
Vnguyen
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group
Carlos Santana wrote:
> I am really confused now.
> The FAQ says - Mongrel uses one thread per request.
> So it can handle multiple requests (not surprising).
>
> What you are suggesting is that my archiving method is trying to make
> another http req. call within same http request?
>
> I can se
Hi Bob,
I am interested. Let me know if this position is still open. I can send
across my resume.
-Ashwin
On Sat, Apr 25, 2009 at 6:03 AM, bobby.cheng@gmail.com <
bobby.cheng@gmail.com> wrote:
>
> Hi,
>
> I'm looking for some who has a good understanding with Rails and
> RSpec.
> You b
Thanks @Tom Ha
I have been looking at YUI earlier. I use Jquery and did find YUI a
bit of a overkill.
Do YUI offer some advantages over other CSS frameworks for example
Blueprint and Grid 960 ? It seems they do more or less the same
thing?
> I likehttp://developer.yahoo.com/yui/
> --
> Posted v
62 matches
Mail list logo