search for: jmwhittaker

Displaying 20 results from an estimated 34 matches for "jmwhittaker".

2006 Apr 27
6
How to trim a string?
This must be really simple but I have looked everywhere. I have a <%= item.description -% in my view and I want to trim it to 10 words. The description can be long and I want to trim this in my preview? -- Posted via http://www.ruby-forum.com/.
2006 Mar 28
2
In_place_editor_field throws error ...
I receive the following error: Called id for nil, which would mistakenly be 4 -- if you really wanted the id of nil, use object_id when trying to use the in_place_editor_field tag: <% for employee in @employees %> <%= in_place_editor_field :employee, employee.fname %> <% end %> My model is called Employee and is being populated from a controller method employees_list:
2006 Apr 13
7
Whats the best way to achieve this?
employees HABTM projects, projects HABTM employees. I am doing a permissions page for a selected project. I know that I can get all of the employees in the system (@employee.find(:all)) or get all the employees for the selected project. What i''m trying to do is get a list of all the employees in the system and have a check box that states if they are associated with the current
2006 Feb 08
3
ungenerate / remove scaffold command?
I have seen this somewhere and can''t find it now. Is there an ungenerate or remove command for the scaffold generator. It would be easier than removing all the files by hand. I have tried ./script/ungenerate but no luck. Thanks -- Posted via http://www.ruby-forum.com/.
2006 Feb 14
2
sqlite and migrations question
I am attempting to start my new application using the migrations feature of rails. I''m not new to databases but new to SQLite. My question is that starting with noting it appears I have to create a table in the SQLite console and then use migrations to delete that table and add more tables. Surely it should be possible to create a blank SQLite database that I can then use migrations
2006 Feb 21
11
helper for models?
Is there such a thing? I have some duplicate methods in my models, can I place them somewhere and call them in to my models, thus keeping DRY? -- Posted via http://www.ruby-forum.com/.
2006 Apr 06
2
rails 1.1 - console broken
Have upgraded to rails 1.1 and now ruby script/console does not work. Throws an error: c:\work\development\rails\application1>ruby script/console Loading development environment. c:/tools/ruby/lib/ruby/1.8/irb/init.rb:151:in `parse_opts'': undefined method `up case'' for nil:NilClass (NoMethodError) from c:/tools/ruby/lib/ruby/1.8/irb/init.rb:19:in `setup''
2006 Jan 27
2
DB & AR advise please (diagram inc)
Hi, Being new to Rails and Active record could someone please check my database diagram: http://spectrais.com//images/0.png I am building a trouble ticket system for my company. Simply put a client has many users. Those users can create trouble tickets. Each trouble ticket can have many journals that track the progress of the ticket. An employee (of our company) can take ownership of a
2006 Feb 19
3
accounts and subdomains
With reference to a previous post:http://www.ruby-forum.com/topic/55201#new I would like my app to function as follows: A new user signs up for my application, his username is "andy". When andy now logs in to the application the url is redirected to : http://andy.myapplication.com Questions: Is this possible to develop on a windows box with webrick? Do I need anything special like
2006 Apr 03
7
Javascript helpers not updating table row in IE6
Trying to replace a table row with an id using both RJS templates and normal link_to_remote :update. Neither work in IE6, fine in FF etc. If I use the same code but target a div with an ID it works. This is tricky as I have a table with edit buttons, when the button is pressed that row gets updated with a partial containing a form for update. I need this to work as II don''t fancy
2006 Feb 20
6
LoginGenerator - multiple user types...
I have been looking at the LoginGenerator gem. Looks great and can be easily modified. However in my app I have two places where people can login, one is for in my case "employees" the other is for "users". They are seperate tables in my database and have many different fields. I have an admin area located at ./sysadmin/ where only "employees" can login, they
2006 Jul 05
4
Hosting client applications - part time developer
I do web development outside of work and I have three new projects starting soon from a little brouchureware site to larger applications. I have a personal hosting account with TextDrive that allows me to run 3 domains, this is not going to be big enough to host the apps for my clients. How do other people host Rails sites & apps for their clients? All this talk of VPS solutions etc
2006 May 10
9
noobie activerecord find query
In my webapp a todolist has many todo items. I am trying to display lists that are completed. By incomplete I mean that all the items in that list are done (booolean = true). I hope to have a list of active lists and complete lists on one page. I''m no ruby expert by any means so I think I have to ''pipe'' some results into another query?? Can you help please? -- Posted
2006 May 02
0
Model validation when using ajax & form_remote_tag...
I am trying to understand why model validation error reporting in Rails is so complicated compared to non ajax model validation. In my normal form I use <%= error_messages_for ''user'' %> in my view and I get a nice error message displayed when the user inputs invalid information into the form. When I convert that form to use Ajax using form_remote_tag the
2006 Apr 05
1
Validation error messages help please
I''m having problems with validation error messages appearing in my app. In Controller: def permissions @roles = Role.find(:all, :order => ''name'') end def new_role @role = Role.create(params[:role]) if request.post? and @role.save flash[''notice''] = ''Successfully created a new Role'' redirect_to :action
2006 Apr 06
1
drop down menu - getting @params[:id] value.
I am looking to get my option drop down list to populate from a model. In my controller i''m using: @roles = Role.find(:all, :order => "name") in my view I have: <%= collection_select(:id, :name, @roles, :id, :name) %> role <%= submit_tag("Go") %> I cannot get just the id of the selected option. If i inspect the params I get:
2006 Apr 07
0
HABTM query return all results
I have a role-based authorization system exactly like the one from Rails Recepies. I am looking to return all rights however in my view I want to highlight the rights that are associated with the currently selected role (passed in through @params[:id]). Schema: create_table "rights", :force => true do |t| t.column "name", :string t.column "controller",
2006 Apr 10
0
Rails form error message oddness...
To get error messages for my form to show up I have to repeat myself in the controller so that the render of the view including error messages show up. ------------------------- My Controller: ------------------------- class ClientsController < ApplicationController #---- index -------------------------------- def index list render :action => ''list'' end
2006 Apr 15
0
Grouped selection lists
I have the Agile book and need to implement a grouped selection list. I have studied the example on pg 360 but can''t fully understand enough to get me up to speed with integrating it into my app (with a HABTM relationship). There seems to be no more info in the wiki or after much googling. Can anyone help me out or point me in the right direction to getting some examples etc?? --
2006 Mar 24
3
generating a controller that inherits from a base controller
how can I generate a new controller that inherites from another bas controller? using: ruby/script generate myNewController command? -- Posted via http://www.ruby-forum.com/.