Displaying 20 results from an estimated 100 matches similar to: "can't figure out this error message please help"
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
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 18
2
Why can''t I use a session? (Symbol as array index)
Hi All
I can''t for the life of me see what is wrong with this. Maybe it''s cause
it''s midnight...
I want to put some data in a session and I have some code like this:
class ApplicationController < ActionController::Base
model :mything
def ApplicationController.chosen_thing
session[:chosen_thing] ||= MyThing.defaultThing
end
end
So whenever I try to
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
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
2006 Aug 15
0
Benchmarking not being included?
I have a problem that''s mystifying me. I have an application that
uses edge rails, and I would like it to put the high level performance
information in the production logs. Other apps I have deployed with
rails 1.1 have production logs that look something like this:
Rendering main/index
Completed in 0.06379 (15 reqs/sec) | Rendering: 0.02569 (40%) | DB:
0.02510 (39%) | 200 OK
2006 Jun 24
0
Theme generator
Hello, I just downloaded the Theme Generator, I set it up and put, theme
''main'' then I got "undefined method `theme'' for MainController:Class"
but, in the readme it dosn''t say to require it or anything what do I do?
--
Posted via http://www.ruby-forum.com/.
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''
2006 Jan 04
0
Simple print statement (was: recongizing the current controller in views)
All (and kevin),
After flying high for a while on Rails things, I''m down to the nitty gritty of
Ruby stuff. Messing with vars and printing them out on a web page.
I found the controller_path in the API docs;
However when putting this in a controller:
@test1 = controller_class_name
@test2 = controller_name
@test3 = controller_path
And this in a partial:
Test1 <%= @test1
2010 Nov 01
1
Encoding::UndefinedConversionError on a simple file upload (rvm, MRI-1.9.2-p0, rails 3.0.1, apache+passenger)
Hello everyone.
I am having the encoding issue on a simple file upload action:
Encoding::UndefinedConversionError in MainController#upload
"\xC4" from ASCII-8BIT to UTF-8
The action looks like this:
def upload
@uploaded_io = params[:upload]
File.open(Rails.root.join(''public'', ''images'',
@uploaded_io.original_filename), ''w'')
2007 Jan 01
0
Simple question on inserting child data
after doing a bunch of reading I have finally sat down to create a
simple app to dirve home a lor of the concepts to which have been read.
So I figured a simple blog app is the best way to do it. The bad
thing is that I am already hung up when creating replies to a blog
posting.
I can''t figure out how to insert the post_id value into the reply
table. When creating a reply the user is
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
2008 Jul 22
0
Routes dependent on subdomain
Hi,
I''m having little problem getting my idea to work, would be very
thankful if you could help me.
I have one Ruby on Rails application sitting on server, and multiple
subdomains, pointing to the same server/app. For example:
mainserver.com
user1.mainserver.com
user2.mainserver.com
I want to have exactly the same app and exactly the same routes on
all, except that I want to map root
2006 Jun 09
3
routes & methods in controllers
still a newbie in rails so bear with me on this one
new test app.... rails test
generate controller main
i add a layout view for main/index & its working ok
i set the routes as follows
map.connect '''', :controller => "Main"
the above is the only route thats active
in the MainController i add in a new method "about"
with a simple render_text
2007 Mar 22
2
method to display the result of find (..) in a view
I''ve been trying to write a method that effectively displays the result
of a find() for say.. my Customer model.
What i''ve come up with is this:
1. The controller
My main controller first makes the query via the model
class MainController < ApplicationController
def index
order =
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
2008 Jul 01
8
redirect_to not working
Hi... I have a basic authentication system. I have a RESTful resource
called session with the following code when logging in:
def new
end
def create
user = User.authenticate(params[:username], params[:password])
respond_to do |format|
if user
session[:user_id] = user.id
flash[:notice] = "Welcome back #{user.name}!"
format.html {redirect_to
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
2003 May 20
0
intermittent failure of ability to connect to samba share from win (NT/2k) client
First, my installation is samba 2.2.8 running as a daemon (not inetd) on
Solaris 8 configured to use a WINS server and provide authentication via
a PDC (same host as WINS server). I do have an lmhosts file in the
samba /lib directory with the PDC/WINS server address in it.
My globals section;
[global]
workgroup = WORKGROUP
netbios name = SAMBASERVER
security =
2003 May 23
0
intermittent failure of ability to connect to samba share from win (NT/2k) client]]
I am not sure if your problem is similar to what we have just experienced.
we are using samba 2.2.3a-12.3 on debian with winxp sp1 clients
we are using roaming profiles
first logon after reboot fails sortof
Windows cannot find a server copy of roaming profile will logon with
local profile
funny thing we never saw any activity in hostname.log (seperate smb.log
for each machine)
smbstatus showed