similar to: Why can''t I use a session? (Symbol as array index)

Displaying 20 results from an estimated 900 matches similar to: "Why can''t I use a session? (Symbol as array index)"

2006 Mar 22
3
stack level too deep error : Pulling my hairs out
Hello, I''ve changed something in my test application and since I can''t find the cause of the "stack level too deep" raising on every request. I''ve removed almost every part of code and the error still occurs, eg with this url : www.myhost.com/main/index routes.rb (nothing else in this file) map.connect '':controller/:action/:id''
2008 Aug 20
0
Re: Help with RoR partial views
Your partial uses a simple form_for(@product) call. By default that will do a POST to the products/create action, which if it''s successful, does a redirect to products/show/<<id for the new product>> (see the create method in your products_controller.rb file). My advice is to just play around w/rails for a bit & get used to its conventions before you try to bend it to
2011 Jul 06
5
Monkey patching a gem (rails_admin, with Rails 3)
Hi. I''m trying to monkey patch the rails_admin gem. First, I tried to add a file in config/initializers containing: RailsAdmin::MainController.class_eval do def get_sort_hash CODE HERE... end end It was only loaded once, and then the method from the gem was always executed instead of mine. I also tried to add the code in lib/ with the correct line in config/application.rb to load
2008 Jul 28
0
Rubygems Issues
I recently upgraded a server''s rubygems from 0.9.0 to 1.2.0. Upon doing so, one of our apps that uses soap4r thinks all the security certificates it sees are invalid (see Error 1 below). I tried reverting to 0.9.0, but anything that uses rubygems crashes now (see Error 2 below). If anyone could help me solve either problem, that would be great. Ideally, I''d like to run the latest
2006 May 04
1
Instance or local vars for field helpers in partial template
I''m getting confused. If I have a view (.rhtml), I can use a field helper like: <%= text_field :mymodel, :attribute %> This uses the value from @mymodel.attribute Now, if I am rendering a template normally (i.e. not partial), I would expect @mymodel to be a model object defined as an instance variable in the controller. However, if I am rendering a partial template, I
2006 Apr 12
3
noob question
Hi *, I am writing my first app based on the ''depot'' application but with some suttle differences to help me learn. I am a bit sutck with following and would be grateful for any help: I have the following controller: class MainController < ApplicationController def index @objects = Object.certified_items end end This relates to a field called
2006 Jun 26
3
RJS Templates with dynamic id names
Due to the use of partials, I''m trying to dynamically generate the ids being affected in an rjs template, but I can''t seem to get the syntax to work. Basically, I need to do the equivalent of this from the .rhtml template: page.show ''mything<%= @thing.id %>'' No joy there. Apparently RJS templates don''t work with embedded ruby. So I tried:
2006 Apr 28
3
Error with show.
Hello everyone, I have a problem while opening something like /main/show/1 Here is the template for show.rhtml <% for name in @names %> <div> <h2><%= name.full_name %></h2> </div> <% end %> And here is the code specific to the show on the main_controller.rb def show name = Name.find(params[:id]) end And here is the error im getting. You have a
2006 Jul 16
1
Helpers for partials too ?
MainController implies main.rhtml, which will automatically have access to the methods inside MainHelper (in \app\helpers\main_helper.rb). Should not the partial templates called from main.rhtml via <%= render :partial => ''partial'' %> also have access to the methods in main_helper ? I have tried <% display_dates = create_display_dates(@events) %> and <%
2006 Jun 12
3
Default value for model var
I know this has got to be a really dumb question, but here goes anyway. I''ve got a model with an associated table. One of the columns in the table is ''date_created'', which I want to be set to the date/time each row was added to the table. Seems to me that setting this in the initialize method for the model would be the right thing to do,... class MyThing <
2006 Apr 25
7
Rails producing the / page.
Hi all Very simple question, im sure, but I cant find docs anywhere that tell me how to do this. What I want is for the index page of the server to be generated from rails, is www.wibble.com/ will result in a page that has been processed by rails, has the templates etc. >From what I can see, the index page comes from public/index.html How do I get this to be a rails page? Thanks Jonathan
2012 Jan 04
1
render :update problem with IE 9
Hi, I have a legacy web site based on ruby on rails 3.0.9 which works just fine with Firefox, chrome and IE 8, but I receive an HTTP 406 error every time when I check the web site with Internet Explorer 9. I narrowed down the problem to the respond_to + format.js + render :update trio, but I did not manage to solve the problem until now. I created a small example for reproduction: The action
2005 Dec 20
0
ArgumentError in Main#index, weirdness.
Hello, I am very new to ruby on rails so any help would be greatly appreciated, sorry if I don''t include enough useful information as I am unsure what will be needed to help with this error. I am using ruby 1.8.3 on debian "testing" along with lightttpd and fastcgi. I have a controller called "main" as you can see in the error output, and when trying to load the
2008 Mar 04
9
What is your workflow? Or how to use the story runner the right way.
I really would like to know how people are using the Story and Example runner to write their software.It would be great to get some direction on it, because I think I''m missing some points. Taking the outside-in approach in thought: At first we write a high-level customer-facing story, this story fails. Then we start using mocks at object level to use them as a design tool, and so we
2006 Jul 10
1
Serializing objects to the database
I have a rails app that has a search mechanism with a bunch of options. I''ve consolidated all the search parameters into a SearchQuery class. Now I want to store searches to be recalled later. I searched the wiki but couldn''t find any pages about how to do this best. I''m worried that if I just serialize the object I won''t be able to change the class without
2005 Mar 15
0
0.10.0, Routes and Query strings
So I made the leap to 0.10.0 but I can not get routes to play nice with query strings... I have this mapping in my routes.rb file map.connect '':controller/:action/:id'', :controller => ''main_controller'' This is all cool and everything works fine http://www.siteroot.com/ maps to http://www.siteroot.com/main_controller/index But when I add a query string to
2007 Jan 10
9
Definition specialization
There was a discussion a while ago about adding inheritance to definitions. There is a need for a way to specialize parameters while allowing passing other options. This comes up with remotefile where it would be nice to have a default server location but not specify all the parameters (and their defaults) in the definition. Was there a change to the syntax? Is there a way to accomplish this?
2006 Aug 01
8
Dumb views?
Hello again! I''ve another "what would you do in this situation" question. You''ve got 6 controllers, one named base. The other 5 controllers extend base. Currently they share one layout. Your layout displays navigation. However, there are two actions inside base for which you do not want navigation displayed (index, new). Do you... a) Add logic to your layout telling
2006 Apr 27
5
ERb on he command line re: Ruby For Rails book
Hi, I am working thru the Ruby for rails book. On page 30 David Black talks about running erb from the command line i.e. $ erb erbdemo.rb just as you would a normal ruby prog ($ ruby erbdemo.rb) but when I try to do this I get command not found. How do I make this work? I am running Linux (Ubuntu Breezy) Regards, Paul
2012 Jul 09
10
attr_accessible on some properties + attr_protected on others makes class 'open-by-default'
(I posted this as a bug in GitHub (https://github.com/rails/rails/issues/7018), but then someone there told me I should post it here, so here it is.) If you set attr_accessible on some properties in an ActiveRecord-descended class, and then attr_protected on others - the class becomes ''default-open'' - if any properties are missed or added later, they will be accessible by