Displaying 20 results from an estimated 50000 matches similar to: "What to use in params[:name]"
2006 Jul 26
2
sessions
hi!
im implementing a login system for a messageboard. tooked from a book.
pretty simple. everythings works great, but in the example the idea is,
when i want to create a new message, the author name shall be tooked
from the session[:user]
def create
params[:message][:date] = Time.now
params[:message][:author_id] = @session[:user].id #here!!
@message =
2006 Jul 21
7
Layouts
I am trying to set the layout for certain actions within a controller,
but not others, but doing
class JoinController < ApplicationController
layout ''form''
def index
end
def add
end
end
sets layouts for all actions, and doing
class JoinController < ApplicationController
def index
layout ''form''
end
def add
end
end
returns an
2006 Feb 02
1
ordering of params
I have a few long forms. I want to email out the user''s response on the form.
So I have something like:
# View
<%= text_field ''answer'', ''name'' %> Name <br />
<%= text_field ''answer'', ''email'' %> Email <br />
......
# Controller
def form_submit
answers = params[:answers]
email_text =
2005 May 17
2
Noob - ActionView::Helpers::FormOptionsHelper::select
Hi,
I''m just starting with Rails and i''m trying to do something like this:
<%= start_form_tag :action => ''add_user'', :id => @social_event_group %>
<%= select ''user'', ''id'' , User.find_all.collect {|u| [ u.login, u.id ]
}%></p>
<%= submit_tag "Add User" %>
<%= end_form_tag %>
2006 Jul 25
11
Prevent users from entering urls
How could I make it so that links on my page could link to a controllers
action, but if the user manually entered the url, it would redirect them
back to the main page? Is this possible?
Thank you,
-Ben Lisbakken
--
Posted via http://www.ruby-forum.com/.
2006 Jan 18
22
Creating multiple child objects from the same form
I''ve been digging into rails, but this one question has been a two day
stumper. I''ve got a question/answer model that I''m trying to work out.
Each question has multiple answers (they''re more like choices, it
doesn''t matter whether they''re right or wrong), and I''d like to have the
question creation form also have multiple fields in
2006 Jul 26
2
How do you stop a ruby method prematurely
Hey guys,
I was wondering how to stop a method without having to perform an action
or redirect?
I tried using "stop" or "exit" but they didnt work
--
Posted via http://www.ruby-forum.com/.
2006 Jul 26
2
There is Something wrong with the div...
<div id="cart">
<% if @cart.items.empty? %>
style="display: none"
<% end %>
<%= hidden_div_if(@cart.items.empty?, :id => "cart") %>
i dont know how to fix it, iv looked all over the book ruby on rails and
cant ever find whats wrong with it...
--
Posted via http://www.ruby-forum.com/.
2006 Jul 26
4
How to Install Engines?
I am trying to get this enginer to work....and I am not sure how to
install the engine? could someone please give me some instructions with
regards to this....
http://rails-engines.org/wiki/pages/DateboxEngine
for example in the website above
The Engines plugin or the EdgeEngines plugin
* Engines 1.0
script/plugin install
http://opensvn.csie.org/rails_engines/branches/engines/
*
2006 Jul 26
6
mongrel_cluster
I''m currently working on 4 different RoR apps all using mongrel cluster and
each with their own config file in /etc/mongrel_cluster. I would like the
ability to stop|start|restart a single app. Anyone working on something
like this? I''d be happy to code it up and contribute this if there''s a
need.
Basically I would like this:
sudo /etc/init.d/mongrel_cluster restart
2006 Jul 25
3
problem with *.foobar.com urls
I am using Apache2.2 + mod_proxy_balancer + mongrel setup and my
mongrel.conf file(for apache is like this)
2
3 <Proxy balancer://mongrel_cluster>
4 BalancerMember http://127.0.0.1:9000
5 BalancerMember http://127.0.0.1:9001
6 BalancerMember http://127.0.0.1:9002
7 </Proxy>
8
9 <VirtualHost *>
10 ServerAdmin rags at
2006 Jan 17
6
An object that initializes multiple objects?
Hi,
Something that I have noticed is that every class that inherits from
ActiveRecord::Base has a database table of its own.
However what if I don''t want a class to have its own table, but to
actually serve as a proxy to initialize other entries?
For instance as an example, let''s have a form with the fields for
"student name", "student id number",
2006 Jul 25
3
Controller namespace problem?
I''m not getting any love grouping controllers into separate namespaces
and I''m hoping someone can tell me what I''m not getting:
$ rails foo
$ cd foo
$ script/generate controller Namespace::Bar index
$ script/server
$ lynx http://localhost:3000/namespace/bar
-> 404
-> Routing Error
-> Recognition failed for "/namespace/bar"
Many thanks in advance.
2006 Jul 26
1
How to create table entry with multiple related categories?
Perhaps I should create a table row to hold an array of category ID''s?
There''s probably an easy standard way of doing this in RoR and I just
can''t wrap my brain around a practical way to do this right off.
Specifically...
I have a table that contains my product category names and another table
that contains my actual product names with other product specific
2006 Jul 26
1
if and else
hey!
can anyone explain me, or put a link, where the syntax and a couple of
examples of the if and else conditions are?
thanks!!
--
Posted via http://www.ruby-forum.com/.
2002 Jun 26
2
change column name in a function
Hi,
I have the following function:
TEST <- cbind(Pox0t30.stone.1990.2000,
sqrt(apply(Pox0t30.stone.1990.2000[,2:11], 1, var)))
In rhe resulting Object TEST the added column is titled:
sqrt(apply(Pox0t30.stone.1990.2000[,2:11], 1, var)
I would like to change it to a sensible variable name like PoxMean. How
can I incorporate this into the above function?
Ulrich
--
2009 Apr 12
9
[LLVMdev] Porting LLVM backend is no fun yet
As we've already seen, David Chisnall prefers hacking LLVM over GCC (see
http://www.informit.com/articles/article.aspx?p=1215438): "In contrast,
every time I look at the GCC code, it takes two people to
prevent me from clawing my eyeballs out."
I'm sorry to report that so-far I have had the opposite experience.
Some years ago, I ported binutils (via CGEN) and GCC to an
2006 Aug 17
6
what did I do to my app? (Superclass mismatch?)
It was working before (as far as I can tell), but I freezed_edge and
now...
The first time I load this page, it works fine, the second time I get
the superclass mismatch, the third time (and any subsequent times ) i
get undefined method.
I think this means my class is getting loaded twice?
my model looks like this:
class Quotation < ActiveRecord::Base
has_many :price_breaks
has_many
2006 Apr 01
0
Many file fields w/same name don''t show up as params array
All,
I have a page where I am allowing the user to specify multiple image
files that are related to one HTML document.
I''m trying to set up my file_field correctly but am having trouble.
I''m trying to post into an array of images that belongs to a document.
I''ve tried:
<%= file_field(''document'', ''image[]'') %>
<%=
2006 Jul 25
4
Problem installing plugins
I''m trying to install a plugin using the supplied command...
$ script/plugin install svn://rubyforge.org//var/svn/backgroundrb
I get an error
sh: line 1: svn: command not found
What am I doing wrong? What is svn, and why is it not found?? It seems
to work for everyone else....
Have I missed something in my Ruby install?
--
Posted via http://www.ruby-forum.com/.