similar to: Where should method shared btwn controllers go?

Displaying 20 results from an estimated 50000 matches similar to: "Where should method shared btwn controllers go?"

2006 Jul 07
7
Sequencing control with edit method in CRUD examples
I have been playing with the cookbook type of tutorials building a fish tournament scoring piece and am having a bit of a problem with a DB field called "points" in my "catch" table that is not input by the user but is calulated based on a "size" field that is input by the user. I have the following in my catch_controller.db def new @catch = Catch.new @fish =
2006 Jul 09
9
undefined method stupidity
I put some code in a before_save callback in the model file to alter some fields that have dependencies in the DB. I''d like to call a method in the controller file but I continually get undefined method errors. I have specified Controller::methodname as well to no avail. What am I missing? -- Posted via http://www.ruby-forum.com/.
2006 Jul 24
3
Confused on URLs to my Rails App
I need a VERY SIMPLE solution to get to my rails app. We have a WHM/Cpanel linux server with numerous virtual servers on it. I have an existing website called www.mydomain.com that lives in /home/mydomain/public_html. I have written a rails app called "test" that is in /home/mydomain/test, and it''s rails "root" is therefore /home/mydomain/test/public. I am an
2006 Jul 20
3
Does Find also tell you a count of the array size?
When I use @persons = Find(:all) (for example) and I get back an array of persons, is there an easy way to tell how many rows the find returned? I have been using Persons.count(:all) but you would think Find knows how many it returned -- is the count/array size stored somewhere in the ret array? -- Posted via http://www.ruby-forum.com/.
2006 Jul 13
10
Problem with flashes staying on between pages
I have a login page that redirects to itself if the login is incorrect. The browser does: get login post login, with wrong username and password redirect back to login When the post action redirects back to login it sets a flash telling the user it failed. So far so good. The problem is that if I get another page after that, the flash is still there. It only disapears on the second.
2008 Aug 15
2
cor() btwn columns in two matrices - no complete element pairs
Hi everyone, I'm trying to calculate correlation coefficients between corresponding columns in two matrices with identical dimensions but different data. The problem is that the matrices contain NAs in different locations. I am using the following code to try to calculate correlations between complete sets of data: #Code start maxcol<-ncol(mat1) for (i in 1:maxcol) {
2006 Jul 11
3
LoginGenerator Killing Me ;)
OK I have dents in my head from beating on LoginGenerator, so if anyone who has used this thing can shed a little light I would greatly appreciate it. It is installed and I have set it up on my User class. Folks can login, logout, etc just fine. I have am not using the per method protection model yet, as I am trying to migrate slowly ;) What is broken though are all my methods that save or
2006 Aug 15
2
PHP files in myapp/public question
I am running mongrel and put some php code in myapp/public, but for some reason they are being treated as html instead of being evaluated by the php interpreter. What do I need to do to get these files treated properly? -- Posted via http://www.ruby-forum.com/.
2006 Nov 04
1
Partials shared between multiple controllers
(Just getting started w rails, web app dev for a long time...) I have some partials that are common across multiple controllers. They''re not universal, so they don''t belong to be part of these controllers'' layouts. It appears that I can put them at the root of /views/, and render them using a relative path, like so: <%= render :partial => "./footer"
2006 Jul 09
8
find_all order question
How does one properly get find_all to grab the data from the DB table ordered by a specific column? For example: @anglers = Angler.find_all This code gets all the angler records and they are sorted in order of the id field which is of course set as a primary key in the DB (mysql). I''d really like to pull the data from the DB sorted in the order of another field, for example
2006 Jul 10
10
IE vs Firefox -- http:// matters?
I just noticed something interesting (or not) about getting to my RoR app on the 2 browsers. I''ve tested it running Webrick or Mongrel_rails and get the same behavior. The app is at http://www.mydomain.com:myport#/app/list Specifying that complete URL works fine in both browsers. However in IE if you just specify www.mydomain.com:myport#/app/list I get page not found. In FF the URL
2004 Jan 13
3
IPSEC btwn stable and Linksys BEFVP41 stopped working.
Hi, I have been using IPsec to communicate between a laptop that tracks -stable and a Linksys BEFVP41 router. I only use it infrequently, but it's been working great. My setup is as described in http://grapeape.alerce.com/linksys-ipsec/article.html (which I am planning to submit to the handbook when it's done). I'm no longer able to make an ipsec connection, and I can't put my
2009 Jun 23
0
render_to_string inside method shared across several controllers
I use render_to_string to generate short reports (in HTML) under certain conditions when users access my application. The reports are stored in the database and uses database information at the time they are generated (and can thus not be generated later, e.g; when you want to consult them). The reports are generated the same way regardless of which controller has been accessed. Conditions for
2009 Aug 18
2
Embedding lists in matrices and matrices in lists
Hi, I'm new to programming, new to R and even new to mailing lists so please be patient with me. I need to manage many matrices generated by an R program. These matrices have different dimensions and I'd like to group them somehow. The best way would be to have a big matrix (let's call it database) where every element database[x,y] consists of a list of matrices that all have the
2006 Jul 07
7
file_column repository broken?
I really want to try out file_column but the repository seems to be down for me. I added it to my repository list and script/plugin is unable to see anything in it. I downloaded an archive from the website but it is not clear to me which files need to be installed to which subdirs of my RoR project. Anyone else having this issue with the repository? I am able to see other repositorys no
2005 Dec 03
1
shared methods for controllers belonging to a specific module
Hi everyone. I was just wondering what the best way ™ might be to let all controllers of a module share methods and variables. Is there some "magic" file rails will automatically load when a module is requested or do I have to manually (doesn''t sound like the rails way..) create a class with the desired methods/variables and let my controllers inherit from it? If so, where
2006 Jul 14
20
Method for associated relationships
I have these tables set up like this: listings has_many :states <field>state_id [int] <other fields.... .............. .............> states belongs_to: listings <field>name <other fields.. ............... .................> In my view I have <%= listing.name %> have also tried listing.state_id.name , that didn''t seem to do the magic either. This
2009 Aug 22
3
Help on comparing two matrices
Hi, I need to compare two matrices with each other. If you can get one of them out of the other one by resorting the rows and/or the columns, then both of them are equal, otherwise they're not. A matrix could look like this: [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 0 1 1 1 0 1 1 0 [2,] 1 1 0 0 0 1 0 1 [3,] 1 0 1 0 0
2006 Jul 13
7
PreP
Hi everybody, I am new with wine. I work on Bioinformatics and I would like to run several windows program on linux. I have had luck with severals programs but haven't with PreP, an important program for me. Could you tell me how run it? The program is here: http://chirimoyo.ac.uma.es/bitlab/services/PreP/downloads/PreP05.exe And I obtain this error: 6667: assertion failed
2006 May 03
6
New Release: One-Click Ruby Installer 1.8.4-17 release candidate 2
We are almost there to a final release. The uninstall issues have been fixed, and a few packages have been upgraded to more recent versions. Many thanks to Ryan Leavengood and Shahank Date who stepped in to help finish off this release! *** Only "show-stopper" problems will be fixed *** We are extreme short of manpower at the moment. So as much as I would like to address each and every