Displaying 20 results from an estimated 9000 matches similar to: "Views in one controller reaching out to other controllers (best practices)"
2006 Jul 19
11
Getting data from the database only once
Hi,
I am a little bit new to ruby. I have a requirement that I need to
get the data from the database. I need to do this many times in the
whole application. But, I am looking for a way with which I can get the
data from the database table only once and store it in some variable,
and I can use it anywhere I want.(I am trying not to use the global
variable for this purpose). Is there a way
2006 Jul 24
3
0.9.0 Version of Gem installation problem?
Hi all. I have installed latest INSTANT RAILS i.e 1.3
When i run the following command:
c:\instantRails\ruby\bin>gem -v
it returns
0.8.11
I want it to be 0.9.0. I have downloaded gems 0.9.0 but i dont know how to
place them and where so that i get the latest version of gems. Please help
me out.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
2006 Jul 24
4
[Slightly OT] Dealing with lost connections
Hi! I know that the web is essentially stateless, so I was wondering
about how lost connections can be managed.
I have an application that posts data to a web form. This form has a
large number of items (about 38) and I''m a bit concerned about the
connection being lost while posting the data. Is it safe to assume that
the web application will reject the transmission if the right
2006 Jul 22
4
Reading floating points into a field stored as Integers
Hi, I''m trying to follow the "AWDR" example of storing certain types of
numbers (in my case, percentages not money) as integers in the
database. I understand from the Depot application how to format the
output to have 2 places (or n places for that matter) decimal.
Now, I"m wondering about the input. It''s more natural for people to
enter numbers as
2006 Jul 23
18
help with "rake db:migrate" error please?
Hi,
Just trying to get my first database based rails app up on
dreamhost.com. The app was working prior to putting in mysql DB usage
but I''m just stuck on getting the app working with mysql. I''ve already
created the database and can connect to it manually.
Below is the error I get after running the rake migrate. It worked OK
on my home PC environment. I did change the
2006 Jul 25
7
Question about Associations and Eager Loading
Hey everyone,
I''m currently making an application that allows users to create custom
fields that have attributes associated with each field.
They can then attach instances of these fields (each with their own
separate attribute instances) to their account.
So, it looks like this:
Fields
/ \
Field Instances Field Attributes
\ /
Field
2006 Jul 21
3
Specifying a view template
I''m new to Rails (and liking it!) and I have multiple controllers, each
of which has a method which uses a view template which is identical to
what the others use.
I would like to be able to have just one template to maintain that they
can all use. What is the customary way to do this? I tried using
render_action to specify the template explicitly, and it "works". But I
2006 Jul 24
3
Customize list.rhtml to display only certain db columns
Hi,
Very new to RoR; have been a flash developer for four years or so. I
have an urgent question -- in the list.rhtml file, I only want to
display certain columns instead of dumping out all the columns in the
database. Could someone shed some light this topic? Thanks!!!
Sam
--
Posted via http://www.ruby-forum.com/.
2006 Jul 23
4
Anything like with_scope for ActionController?
There are areas of my application that "want" to use a url structure
like
domain/<human_readable_param>/<Module>/<Controller>/<Action>/<Id>
Please note that the human readable parameter I need to inject is NOT
related to the <id> being used by the action/controller pair. It''s
identifying a container object whose contains are operated
2006 Jul 22
7
Validation with has_many
I have two problems. I have a comment that has_many uploads. Before
saving the comment, I want to be sure that the upload(s) has passed
validation, but I also need to validate in other ways. For example, I
do not want to save the comment if there is no comment or upload. Or, I
do not want to save the comment if the image has been uploaded
previously (comparing md5s with past upload md5s
2006 Jul 21
3
Re-formatting email line breaks
I''m trying to re-flow email messages, removing the line breaks that
get added by mail programs so that the lines don''t exceed 72 characters.
Mail.app and Thunderbird seem to insert a space character before each
added line break.
Outlook replaces new lines in the email with double \n''s, then uses
single \n''s for the ''soft'' line breaks.
2006 Jul 23
8
embedding subversion version information into HTML
Hi,
Say I want to display the subversion release number in the footer of
each page in order to track what version of a site I''m looking at.
I know subversion has a substitution keyword (LastChangedRevision)
that inserts the last known revision in which that file .changed.
So, if I stick $LastChangedRevision$ into
views/layouts/application.rhtml, it''ll show the last time that
2006 Jul 23
2
How would you do this without using render_component
Hello all.
Am relatively new to RoR and I am pondering how to do something without
using components since they appear to be "coda non grata".
I have a standard layout that is used by all controllers. In this layout
I want to list the next 5 events that are upcoming based on todays date.
These events are currently stored in the Event model (created using
scaffolding). Currently only
2006 Jul 20
7
Can this be done?
What I want: I get a normal http request containing a URL from a remote
server.
Instead of redirecting to that URL, I want to load it into an iframe on
an existing page.
I''ve tried a number of approaches with no success.
Can anybody suggest a good way to do this? Alternatively, if you can say
"this is bloody impossible, because....", that would be helpful, too.
--Al Evans
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 Jul 23
2
Accessing form values
Hello - Rails newbie here.
I have the following form with this input box:
<%= text_field_with_auto_complete :product, :name%>
How do I extract its value on my controller?
I''m trying this:
@query = @params[:name]
I see that :name is making it into my params hash:
{"product"=>{"name"=>"ipod"}}
But I can''t seem to extract its value!
--
2006 Jul 19
12
[Slightly OT] POSTing data to a Rails App
Hi, I have a Windows program that collects data and would like to store
this data in a database that is usually accessed through Rails.
It was recommended that I try to "POST" the data to the Rails
application. I''m running into some problems trying to format my POST
string for the application. I''m trying to learn by interfacing to the
TODO application (Four Days
2006 Jul 25
3
Ruby hangman (was Re: List etiquette question)
"Beast" is more appropriate than you know. It''s definately Frankenstein
code. (read: it ain''t pretty, but it works - some of the time). Anyway, it
entertains my wife; not sure if hardcore programmers will get anything out
of it or not.
You might find it interesting (or pointless) that in a complete
bastardization of rails'' main reason for being it
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/.
2006 Jul 23
4
ActionWebServices
Is there a problem with Direct Web Services on Windoze?
A routing error occurs with simple controller/api configs as
described in the AWDwR text. route.rb has a wsdl route, but
I would like to scaffold it to render either wsdl or ws
functions from localhost:3000/ctrlr/invoke or localhost:3000/ctrlr/wsdl.
--
Posted via http://www.ruby-forum.com/.