Displaying 20 results from an estimated 10000 matches similar to: "ROR questions"
2006 Aug 07
1
datetime_select problems
Hi,
I have a datetime select in my form like this:
DATE/TIME REPORTED: <%= datetime_select ''report'', ''rep_date'' %>
This works beautifully for creating a new record. The data is saved as:
2006-08-07 11:33:00
Now, the problem is when I try to load the form with saved values
to do an update.
The above code works and loads the saved data in another one
2006 Apr 07
4
STI and foreign_key problem
Hi,
I am trying to use STI since my classes only vary by one column in the
database.
Here is the structure (names have been changed to protect the innocent):
Case
/ \
Registered Initial
\ /
Children
A registered case has additional information than an initial case (I
realize I could just set a flag to separate them, but there is a good
reason to separate
2006 Jul 13
5
Relationships: one model referencing same table for different data sets?
Hi,
After I''ve saved, I want to display the Description from the Codes table that
corresponds with the ID in the Cause table.
Rails doesn''t seem to like that, because on my form, I have two sets of data in
combo boxes that come from the Codes table. So, in the show template, I can''t
do this:
Cause of Death: <%= @cause.code.description %>
Any ideas?
The
2006 Jul 03
6
help!
Hi,
i''m fairly new to ruby on rails, and i know the question at hand may
seem simple at first, but i''m getting really caught up in trying to
understand this and the docs aren''t giving me answer. i actually thought
i knew how the sql commands work (like :include, :conditions, :etc) but
obviously, i don''t.
there are three models M1, M2, M3 joined by a habtam
2006 Jul 02
2
searchbar help!
Hi all,
i am after hours unfold of trying to implement a searchbar in a table
with a habtam relashinship, but alas ! with no success... i was hoping
some kind gentle mind can help me through these diffucult times; i have
now reached the point where out of sheer annoyance, i cannot see myself
getting anywhere nearer to the target, and was hopefully hoping one of
you out there could help me
2007 Apr 19
1
How to redirect to other action when it is called using ajax
Hi all,
I am using javascript to call an action with some parameters. In that
action i decide on the basis of parameters either to render some text on
that page or to re direct to some other page. But its seems that my
redirect_to method is not working from that action. Can anybody tell me
some way of redirecting to some other action when that action is
called as a remote_function from
2006 Apr 24
3
Rails Recipes Book: Routing Error
Hi,
I''m working on the first rails recipe, InPlaceEditing, and following the
instructions very carefully. After generating the scaffold for Contact,
I then go to the page, thus:
http://localhost:3000/contacts/
I get this error:
Routing Error
Recognition failed for "/contacts/"
What should I be checking for to resolve this problem?
Thanks.
--
Posted via
2006 Mar 22
7
What is difference between render & redirect methods?
Hi,
Thest are two methods:-
1) redirect_to :action => ''list''
2) render :action => ''list''
what is difference between these two methods??????
Thanks.
Prash
--
Posted via http://www.ruby-forum.com/.
2006 Apr 21
1
Catch authentication result from a model in a controller
Im still following the authorization recipe from the book, now all works
fine but im getting trouble in how handle the model authorization
result, if the user and pass are correct, it goes to a welcome
screen(admin.rhtml) but if wrong the model prints a message in an ugly
exception like page "usr and pass not correct", i want to redirect the
user to the login
2006 Jan 19
6
One Last Question for me..
And then I should be ready to roll with my project.. I have some fine
tuning of the looks to do after, but funtionality first!
This is probably a rails question.. but I''m not sure where to sign up
for the rails questions email group? (I guess I turned this into a 2
question email).
I''ll ask here and then if someone will send me the url of where I go
to sign up for the rails
2006 Feb 22
2
Merging data
Hello all,
I am fairly new to R and am trying to bring together data from multiple sources. Here is one problem that I cannot seem to crack – I hope somebody can help. Let me simplify the problem: Let’s say I have two datasets: DATA1 and DATA2. I would like to work with all the cases in DATA2. I have additional variables on these cases in DATA1, which is a larger data set with many
2006 Apr 11
7
Undefined Method
Where can I define the method ''tbluser'' in this error?
NoMethodError in Tblregisteredphone#list
Showing app/views/tblregisteredphone/list.rhtml where line #23 raised:
undefined method `tbluser'' for #<Tblregisteredphone:0x375c778>
Extracted source (around line #23):
20: </font>
21: </td>
22: <td>
23: <%= link_to
2006 Jul 17
10
getting the user name
Hi I am new to ruby and trying to obtain the user name in the login
index.rhtml where I could display "You have logged in [user name]"
How could I do this? I have been trying different options after reading
the ruby manual but still throw an error.
please help
--
Posted via http://www.ruby-forum.com/.
2012 Apr 13
2
Long command in Sweave
Dear useRs,
I am writing a vignette for a package, which contains long command like this,
>reduce(Lipset_cs,"SURVIVAL",c("GNPCAP", "URBANIZA", "LITERACY", "INDLAB", "GOVSTAB"),explain="positive",remainder="exclude",case="CASEID")
It is longer than the width a page and part of it will become
2006 Jun 20
2
Validation error_messages_for problem
I am having trouble getting error_messages_for to work.
My controller(relevant parts) looks like
def configure
@account = session[:account]
@user = User.new
end
def add_new_user_to_account
@user = User.new(params[:user])
if @user.valid?
session[:account].users << @user
end
redirect_to :action=> ''configure''
end
end
and my
2006 Mar 24
6
login forms , redirect_to and ajax-scaffold problems
Hi,
I have a standard type authentication technique direct from AWDWR, so there is a
before_filter :authorize_employee, :except => :login in my employees_controller.rb
the authorize_employee is in application.rb
def authorize_employee
unless session[:employee_id]
flash[:notice] = "Please log in"
# save the URL the user requested so we can hop
2006 Jul 26
7
syntax for specifying :html fallback on form_remote_tag
Has anyone gotten the :html option for specifying a ''fallback'' action if javascript''s not enabled working on form_remote_tag (or remote_form_for)? I can''t figure out how to specify the action that''s supposed to be invoked if js _is_ enabled.
Or maybe I''m just misunderstanding how this thing is supposed to work. I was assuming
2006 Jul 14
3
compare two tables and find the difference?
I need to compare a column in TableA to a column in TableB and then
select 3 columns from TableA for all the records in TableA that don''t
exist in TableB.
TableA and TableB are different but do have one field in common that i
am comparing. The tables are not related in anyway.
right now I have a find_by_sql query located in a model that looks like
this:
def self.absent_charges
2006 Mar 17
2
Validation not working.......
HI,
I am new to ruby. I am developing small application in ROR. Following is
code for my rHtml , Controller & Model. PLease see it & let me know why
data in form is not get validated & also how to check for whether data i
have entered in form (username) is present in database or not? (Like
Login form).
following is my code:-
---index.rhtml--------
<%= start_form_tag(:action
2006 Jan 19
8
Passing variables across forms
I''ve been reading my Agile Dev book over and over again, but I can''t
wrap my head around how to do this. There''s a question and answer
portion site of my site. You begin the process by adding a question to
the database. After that, the program should redirect you straight to
adding an answer for that question. The problem is, I don''t know how to
keep