similar to: newbie q on displaying a db field value in the view

Displaying 20 results from an estimated 10000 matches similar to: "newbie q on displaying a db field value in the view"

2005 Dec 12
7
Calling absolute links
I have a primary layout that I''m using in several controllers. On my sidebar I have a link that I set up as follows: <div id="sidebar"> <%= link_to("Items", :action => "list") %> </div> Everything is ok when I call it from my primary controller, but since I am also calling the layout from a second controller that does
2009 Dec 12
2
View change on db field change
I have an issue whereby, say I have a button in a view......that shows one way if a boolean field in a db is true, and another way when it is false. When the value of that field in the db changes, I want the button;s state in the view to change as well. How would you guys recommend I do this? Thanks, R.Vince -- You received this message because you are subscribed to the Google Groups "Ruby
2009 Jan 26
5
Please help with a routing problem
Hi All I''m having some issues with the following routes problem. The routes.rb file ... map.resources :users map.connect ''/users/view_payments/:user_id'', :controller => ''users'', :action => ''view_payments'' The users_controller.rb file ... def view_payments @user = User.find[:params[:user_id]] @payments =
2010 Jul 06
4
Simple routing problem
I''ve got the following in config\routes.rb: map.resources :users In app\views\shared\_menu.erb, I''ve got: Please sign in <%= link_to "here", :controller=>"user", :action=>"sign_in" -%> In app\controllers\users_controller.rb def sign_in end When I run the application, I crash with: Routing Error No route matches
2006 Apr 15
9
newbie q: acts as authenticated or login engine?
I''m trying to create a basic web page where people can register. Before they are approved they are emailed a link where that they must click in order to verify their info is correct (or at least their email). Should I use acts as authenticated or the login engine for this? http://technoweenie.stikipad.com/plugins/show/Acts+as+Authenticated http://rails-engines.org/login_engine TIA
2006 May 08
1
newbie: Login/Logout in view
I am using the acts_as_authenticated plugin to manage logging in/logging out. There are a few controllers, such as search, that I don''t mind people accessing regardless of whether they are logged in or logged out. My current view just has some static links on the left that say Login and Logout. How should I set it up so that it says Login when not logged in and log out when logged
2008 Jan 23
2
integrate_views is not executing my views
I wanted to use "integrate_views" as Ryan explains in his RailsCast #71 (http://railscasts.com/episodes/71) ...but I can''t get it to work: the view code in not executed I looked everywhere but I can''t understand what I am doing wrong. Here is what I did: I created a new application from scratch (Rails 2.0.2), added rspec and rspec_on_rails plugins, and run
2006 Jan 20
5
Instance variable?
I''m trying to grab a temporary variable from my view and then pass along that value to my model My view code is this: <td width="40" align="center"><%= text_field ''product'', ''qty_added'', {:size=>3} And I''m trying to pass the qty_added variable to my model. item.quantity = qty_added It doesn''t seem
2011 Jun 12
3
Problem with undefined variable current_user
Hi everyone, I''m working through the tutorial at the following link and attempting to customise/adapt the lessons for my own slightly different application. Link: Ruby on Rails Tutorial: Learn Rails by Example | Ruby on Rails 3 Tutorial book and screencasts | by Michael Hartl <http://ruby.railstutorial.org/ruby-on-rails-tutorial-book> I''m currently trying to work
2008 Jun 04
5
controller filters running twice in 1.1.4?
since upgrading to 1.1.4 (I had been running without issue on a git snapshot), I''m noticing that my filter actions initiated from application.rb seem to be running twice. I created a test rails project with the rspec scaffold and am also seeing the same behavior here too. Adding this code to application.rb: before_filter :foo def foo "foo" end and an example
2012 Jun 09
7
ActiveRecord::AssociationTypeMismatch in UsersController#update
Hi Im trying to link my User model to a Teams model. I seem to be getting the following errors. Any help would be great as Im just new to RoR Thanks error ActiveRecord::AssociationTypeMismatch in UsersController#update Team(#2183395560) expected, got String(#2174675960) app/controllers/users_controller.rb:67:in `update'' app/controllers/users_controller.rb:66:in `update''
2013 Oct 21
6
I think I've found a mistake in Rails tutorial
At the point of this section *http://ruby.railstutorial.org/chapters/sign-up#sec-signup_failure*<http://ruby.railstutorial.org/chapters/sign-up#sec-signup_failure> clicking the "Create my account" button on the signup form shows the following image at <http://ruby.railstutorial.org/images/figures/signup_failure_rails_4.png> According to the tutorial, I must modify
2006 Apr 15
19
Trouble with Lighty
I''m trying to setup my rails application with Light+fcgi. This is the error I''m getting when I try to start Lighttpd : ============ [getcapture@alpha getcapture]$ ~/etc/rc.d/lighttpd.sh start Starting Lighttpd 2006-04-15 11:27:24: (mod_fastcgi.c.1022) execve failed for: /home/getcapture/application/public/dispatch.fcgi No such file or directory [getcapture@alpha getcapture]$
2012 Oct 08
11
Problems setting gmail mail
Hello, as attachment my problems concerning gmail Mailer errors in Rails. I hope anyone can help me out with the problem? If there is extra information needed, please tell me what you need more to help me out of my problems! Greetings! Attachments: http://www.ruby-forum.com/attachment/7790/errnoECONNREFUSED.jpg -- Posted via http://www.ruby-forum.com/. -- You received this message
2012 Jul 26
2
Develop resources within namespace
Hi, I want to develop my resources that deal with CRUD operations on my models in a namespace of /admin. How is the best approach to do this? What needs to be changed in order to do this? As in my last attempt of moving things to a namespace my software broke. TIA, Dean -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To
2007 Jul 23
2
Firebird, fireruby
Hi Guys I am pretty new to Ruby. One of our client is using Firebird as his backend database. I have to create a script which will connect to his database, fetch some data and update few tables in MS-SQL database. Now problem is: i have installed FireRuby, got databaes, changed my database.yml file. I am trying to display all the users in Members table. but i am getting following error:
2005 Dec 14
9
Passing quantity in a shopping cart
I am using this line on my index.rhtml page to capture the quantity required of a particular item for a basic shopping cart app: <%= text_field ''line_item'', ''quantity'', {:size=>3} %> </td> but my next screen (a cart screen) doesn''t reflect what was entered in that text field when the item is added to the cart. That is,
2012 Aug 07
9
How do I force link_to/form helpers to use the superclass name in the path instead subclass?
I want my helpers to generate paths using a superclass instead of the subclasses. Assuming I have Owner and Member that both inherit from User, rails will use the current objects class name when generating paths: Let''s say current_user is a mod: <%= link_to current_user.name, current_user %> will generate "/mod/:id". I want to force it to generate
2006 Jul 31
4
Login Password text field values
I have a text field that I use for logging in users. Due to the design of my site, I don''t have room to put the word "username" in front of the text field so I''d like to actually display it inside the field and then have the word clear when the user clicks on it. How could I modify something like this <%= text_field "user", "login", :size
2005 Mar 07
2
erb and builder in same view ....
Has anyone tried using erb and builder in the same file? Either .rxml or .rhtml? I''m wanting to do some think like the following: xml.div(''id''=>''menu'') {|xml| link_to "create race", :controller=>"derby", :action=>"new" } Thanks, -- Tom. -- "Nothing will ever be attempted, if all possible objections must