similar to: Defining a variable in the environment and using it in controllers and views

Displaying 20 results from an estimated 20000 matches similar to: "Defining a variable in the environment and using it in controllers and views"

2006 Aug 04
1
route error with controllers in a module, should just work
This is ALL I have added to my routes.rb map.connect ''admin'', :controller => ''/admin/welcome'' I have found plenty of examples saying this is correct if you have a WelcomeController in the Admin module, which I do :) But now webrick won''t even start ??? Look at those 4 colons ::::, what is that about ? help ! => Booting WEBrick...
2005 Dec 23
6
Stories with many tags, tags with many stories, has_and_belongs_to_many howto?
Hi, I began experimenting with habtm relationships, and so I created a stories table, a tags table, and a stories_tags table referencing the former 2. When I create a "story", I want to add several tags to it. Then, the model should create those tags and link them to the respective stories, and for the tags that already exists, just link them to the story. I tried something like
2005 Dec 27
6
Best Environment for development
This is a newb question, and probably one that is a matter of taste more than objective merit. I''m working on a home server, running Linux [FC 4], hosting a website [look for generocities.com shortly]. I have a delightful new Windows XP Pro Dell Inspiron 9300 laptop. What would the community recommend for the environment in which I develop? I don''t mean technologies like RoR
2006 Jan 04
2
Creating a model that acts as a settings manager
Hi, I was wondering how could you create a model that is tied to all the records in one table, and retrieves the values of all records on first load, and also handles the updating of its values. For example, suppose I have this table: id INT(11) PK group CHAR(40) name CHAR(40) value CHAR(128) updated_at DATETIME Sample rows: group name value --------------------------- main something
2006 Sep 07
6
Template "specialisation"
I want to use a sitewide default template and use a specific version in some controllers to have a good DRY approach to my layout. Those controllers should add a little bit more HTML before rendering the results of the actions, in order to avoid copying the entire sitelayout every time. How can I do that? Currently my code is like this: class WelcomeController < ApplicationController
2005 Dec 16
3
Using :include "recursively" (including the children of the child)?
Hi, Let''s say I have the following hierarchy of tables: Group <- parent Location <- child of Group School <- child of Location Phone <- child of School Then, if I want to do this: Location.find(...someparms..., :include => [:schools, :group, :phones]) I get an association error (Association was not found). I guess it happens because AR is looking in the Location model
2006 Feb 23
5
Help with SCGI please :(
Hi, While learning Ruby and Rails, I decided I just as well learn Linux along the way... It''s been fun, but I''m stuck at one of those exasperating moments... I hope someone can help me :) I installed Ruby 1.8.4 on Fedora Core 4, then Rails, then lighty, and then SCGI. I used yum to install lighty... and it already comes with mod_scgi. I created my first application in
2006 Jan 06
4
"Selecting" a calculated row / Using :select in the paginate method
Hi, I was trying to use the :select parameter to select a calculated row, but it appears that the parameter is not picked up by the paginate method. I want to add the following to the select statement: timediff(now(), created_on) as age So I tried: @story_pages, @stories = paginate :stories, {:per_page => 10, :include => ''user'', :select =>
2011 Jun 09
8
Fail to call
Hi, I''m trying create a user system for a future project but I have a problem when I want give to my users the "Welcome". This is my code: #application_controller class ApplicationController < ActionController::Base protect_from_forgery helper_method :current_user private def current_user_session return @current_user_session if defined?(@current_user_session)
2010 Sep 22
2
defining set of variables in a formula
Dear fellow R users, I am trying to conduct a regression analysis. I have thousands of variables. The names are V1, V2,........V2000 Is there an easy way to include these variables in the regression? my model is something like that: model<- lm(y~V1+V2+.....+V2000, data=data) Thanks so much in advance, Ozlem
2010 May 20
1
use object within rda file in for loop
Dear users, I would like to process all the lists from all *.rda files that I have in one folder. Up to now, I can load all the *.rda files without any problem. The problem is when I want to access the list saved within each *.rda file (only one list per rda file). Here is my code: fpath <- "D:/R" listnames <- list.files(path=fpath, pattern=glob2rx("*.rda"),
2007 Oct 16
6
RailsStory runner - empty response
I generated a new rails app then installed rspec and rspec_on_rails from trunk. I then created a sample story: require File.dirname(__FILE__) + "/helper" Story "View Home Page", %{ As a user I want to view my home page So that I can get a birds eye view of the system }, :type => RailsStory do Scenario "Publisher with no videos" do When
2007 Oct 16
5
RailsStory - lessons learned
After trying RailsStory for a few days, I have learned: 1. Rails testing support does not serve up static pages 2. RailsStory masks errors generated by the app under test 3. The masked errors are available in log/test 4. I should read log/test more often See http://pastie.caboo.se/107876 for an example for points 2 and 3 The welcome controller fails when the HTTP_USER_AGENT is missing.
2008 Apr 09
1
R in a cluster environment?
I'm a cluster administrator and one of my users has requested that I install R on our system. Can R be used in a cluster computing environment that utilizes batch processing, i.e. no graphical output during processing? Also, can R be parallelized to run on many nodes/processors simultaneously? Ivan Ivan E. Tornes Ph.D. Battelle 505 King Avenue Columbus, OH 43201-2693 ? Phone:614-424-5165
2006 Apr 21
1
Using fixtures inside migrations
Hi, I want to add data from a fixture file to a table inside a migration. I''ve saved the file in db/migrate/fixtures/countries.yml I guess I could just open the file, read the entries, and add them to the database using AR, but I''m hoping I can use Rails for all that. Also, if I have a file, say, with 200,000+ records, what would be the best method (performance-wise) to go
2006 Jun 27
1
Help me, I stuck ..
I have three tables and is not allowed to change data scheme: CREATE TABLE `applicants` ( `id` int(10) unsigned NOT NULL auto_increment, `fullname` varchar(60) NOT NULL default '''', `address` varchar(60) NOT NULL default '''', PRIMARY KEY (`id`) ) ; CREATE TABLE `positions` ( `id` int(10) unsigned NOT NULL auto_increment, `position_name` varchar(30)
2006 Jan 06
6
RoR API Firefox search plugin
Hi, Lately I''ve been visiting the RoR API site quite often, so I modified a Firefox search plugin to make searches to it (with Google). So here I post it in case someone finds it useful: <SEARCH version = "7.1" name="Google - RoR API" description="RoR API SiteSearch" method="GET"
2024 May 14
1
FR: Customize background colour of row and column headers for the View output
This seems like something that should be fairly easily doable. Why don't you work out a patch? Some decisions to make: - What colours are we talking about? Would you want the labels to have their colour set independent of the dialog colours? If so, would you also want to configure the dialog colours? - What names should be used for the colours? - Where should all of these definitions
2024 May 15
1
FR: Customize background colour of row and column headers for the View output
About the decisions: Actually, the same way dataedittext modifies the text colour not only of data, but also of row and column names, and dataedituser modifies the colour of all the borders, I think dataeditbg should modify the background of all the window, at least that "inside" those borders. Otherwise, any other option for the background colour on row and column headers would allow
2024 May 14
1
FR: Customize background colour of row and column headers for the View output
Thanks again Duncan and Ivan, I forward then the email to R-devel. Summarizing, the dataedit options (in RGui preferences or RConsole) to colouring the View output do not have effect on the background of the row and column names (see https://ibb.co/Dkn2pVs). Could this be implemented? Thank you! Best regards, Iago ________________________________ De: Ivan Krylov <ikrylov at disroot.org>