similar to: drop down menu - getting @params[:id] value.

Displaying 20 results from an estimated 3000 matches similar to: "drop down menu - getting @params[:id] value."

2009 Feb 17
3
Dynamic select box
Hi everyone, I have a problem. I want to display a different select box wether the current user is an admin or an user. So I thought I could do this in my view where my form is displayed : <p class="form-input"> <%= f.label(:role_id, ''Role:'') %> <% if (current_user.admin?) then collection_select(:user, :role_id, Role.find(:all, :order =>
2011 Aug 11
17
f.collection_select: what are the parameters?
The rails docs are so horrible on the collection_select method. They need to show a *complete* form, and show two examples: one that calls f.collection_select(), and another that calls collection_select(), and explain the differences. Given this line: f.collection_select :topic, Topic.all, :id, :category What the !@#$!@#$ is :topic? -- Posted via http://www.ruby-forum.com/. -- You received
2006 May 11
1
ActiveRecord collection_select and has_and_belongs_to_many
Hello everyone, first post to the list and a relative newbie to Rails development. Done quite a bit of JSP, PHP, HTML, XML etc and thought I would kick the tires on Rails to see if it can speed up development for internal applications. Anyway, I am running into a problem that is just driving me crazy and everything I read on the net doesn''t seem to help. I was hoping someone here might
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 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
2010 Feb 10
7
undefined method join
Hey all, I get an undefined method `join'' for #<String NoMethodError. student.rb has_one :student_fail attr_accessor :student_fail_attribute #controller def student_fail @student = @student.find params[:id] def update_student_fail @student.build_student_fail params[:student][:student_fail_attribute] if @student.save #view form_for @student do |f|
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 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 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 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 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 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 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 27
3
collection_select to display 2 fields
I''m trying to get a collection_select generated Drop-down box to display two fields from a table (first name & last name); however, I am having trouble concatenating the symbols. It appears as though any code I put in the 5th argument for collection_select is processed prior to executing the collection_select method. The code executes successfully with 1 symbol in the 5th
2009 Aug 11
5
Dynamic drop-downs in a form_for using AJAX remote_function - Help
Hello - I am fairly new to Ruby on Rails, but feel like I am learning quick. I have what seems to be a fairly unique issue as I cannot find much out there that describes what I''m seeing. Hopefully it''s a very simple fix, and I simply can''t see the forest through all the trees! I am attempting to create 2 related drop-down lists in the same form_for, both using
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
2007 Dec 09
4
Help on drying code
Hi all, Currently I''m having to do this: def self.authorized_roles(controller, action) specific = self.find_by_controller_and_action(controller, action) all_actions = self.find_by_controller_and_action(controller, ''*'') all_controllers = self.find_by_controller(''*'') role_ids = [] specific.each do |role_item| role_ids <<
2007 Aug 03
2
Does collection_select work in list.rhtml?
Hi, I have 2 models: Model 1: er, Columns: <er_id, er_name> Model 2: er_process, Columns: <er_id, er_process_name> er_id is a foreign key for Model 2. When I am creating a new er_process or editing an existing one, I have been successful to use collection_select to show the available er''s so that the user can select a particular er by its name (to populate the er_id
2006 Apr 15
6
view code regular expression
I''m lost on regular expressions to begin with... I''m trying to fix a value to one of 4 radio buttons as there will be value of either 1,2,3 or 4 in @roles_users... <TD><input type="radio" id="roles" name="case_managers[case_manager_name]" value="Case Manager Admin" <% if =~ @roles_users /1/ checked =
2013 Jun 18
1
How to Pass Jquery selected dropdown values and radio button values to controller
Hi, I have an advance search page and its code is as follows - I have written my code like this <div class="container"> <%= form_tag search_index_path, method: :get do %> <%= radio_button_tag ''user_type'', ''customer'' %><p>Customer</p> <%= radio_button_tag ''user_type'',