similar to: How to get a users screen name into a hidden field in a PostsController action?

Displaying 20 results from an estimated 2000 matches similar to: "How to get a users screen name into a hidden field in a PostsController action?"

2006 Jul 08
4
Hidden fields in forms
Please can someone show me the correct syntax for a hidden field in forms, this is my code <%= start_form_tag :action => ''create'' %> <div class="form1"> <table width="auto" boader="8" cellspacing="5" cellpadding="5"> <% hidden_field ''line_item'', ''client_id'', :value
2006 Jun 04
3
passing a value in a hidden field inside a form
should be trivial but I can''t figure this out from api <%= hidden_field ''certifications'', ''personnel_id'', {value = #{@personnel.id}} %> I want to pass the value of ''id'' field in my form to the certifications controller as personnel_id Craig
2007 Sep 22
1
Rails newbie: passing a value to hidden form field, then getting it
Warning: I am as green as #00FF00 with rails :-) I have an rhtml view that shows a survey: /views/survey/show.rhtml. I have a Survey model, helper and controller. I''m using the acts_as_commentable plugin to collect comments, and trying to save user comments from users who have taken a survey (don''t ask -- it''s just a test). To save the comment, I need the id of the
2010 Apr 12
3
$(link).previous("input[type=hidden]") is undefined
I am getting this error when trying to use the remove link explained in the Railscast: http://railscasts.com/episodes/197-nested-model-form-part-2 error: $(link).previous("input[type=hidden]") is undefined remove_fields()applic...1065175 (line 6) function onclick(event) { remove_fields(this); return false; }()1 (line 2) [Break on this error]
2006 Mar 10
2
Syntax for <input type=hidden> in rhtml????
Hi, I am new to ROR. PLease tell me what is syntax of creating hidden field in form inside RHTML file. I knonw the syntax for text box (<%= text_field ''product_item'',''product_id'', :value=>product.id%>) But I don''t know syntax for hidden field(like <input type=hidden> in HTML). Please tell me. Thanx in advance. Prash -- Posted via
2008 Jun 02
0
Rails 2.1 - when PostsController is present, creating Admin::PostsController fails
Hi, just found out small problem with Rails 2.1. If I run a "script/generate scaffold post title:string" that creates PostsController and later want to make admin controller for it by running "script/generate controller admin/posts", Rails complain that: "The name ''Admin::PostsHelper'' is either already used in your application or reserved by Ruby on
2007 Dec 16
0
pass the model type to the action via a hidden field?
I have a question about the acts_as_commentable plugin. In the instructions it says to use hidden fields to pass the model type and model id. This is somewhat confusing me. I am trying to add comments to a user object and am not sure how to specify the model type. This is the link that I am using to get the comment view where one will enter his/her comments: <%= link_to "add a
2010 Jul 31
4
Exception: can't dup Symbol
Hey everybody, I''m trying to test a little piece of code I wrote, and I get the following error: Exception: can''t dup Symbol It happens in the following line: try_to_login @valid_user, :remember_me => "1", where the function try_to_login is: def try_to_login(user, options = {}) user_hash = {:screen_name => user.screen_name, :password => user.password}
2006 Feb 06
1
Check, and display, AIM status on rails page
Thought I''d post this in case it''s of use to anyone. Maybe even a recipe? It''s just some simple helpers to show AIM status on a webpage. I searched before coding it, and didn''t find anything similar. Maybe that''s because it was so simple :) These methods belong in a helper (such as app/helpers/application_helper.rb) # begin AIM helper methods def
2008 May 03
2
ActionMailer Multiple recipients
I am using ActionMailer to send mails. I want to send mails to multiple recipients which I get from a view. Here is the controller code. def groupcorres user = User.find(session[:user_id]) address = Array.new lines = Array.new args = params[:id].to_s # params[:id] is an array of user screen name. ex: j_doe, d_john lines = args.split(",") for line in lines
2008 May 09
4
Validating Uniqueness From Two Database Tables?
Well, I''m working on adding a new type of user (organization) to my application, using a different database table than the standard User table (in the end, I think it works out being easier to deal with than creating another column in the original User table for account type). However, I''m running into a user registration problem. I can register both types of users fine,
2006 Feb 22
15
Fixtures and Relationships
In my daily development, I migrate back and forth between versions, and often do: rake load_fixtures... ... in order to populate my development database with fun data. Now, with any HABTM relationship, there are failures, as there is no way to say "which" fixtures to load first. Within an actual functional or unit test case, you could simply load them in the proper order, but
2005 Sep 29
1
Error using a data frame as the "start" parameter in mle()
Dear R-Users, I am trying to use mle() to optimize two (or more) parameters, but I want to specify those parmeters in a data frame rather than having to spell them out separately in the "start" variable of mle(). My call is > mle(negll, start=list(aps=init), fixed=list(measphot=newphot, formod=formod, Nbands=Nbands), method="BFGS") where negll is a function I have
2009 Sep 12
3
Cannot get my password to validate
Hello, I am working through the railsspace tutorrial, and i''ve noticed that the password validation is no longer working. I can get screen_name and email to validate, but for some reason, the password field is ignored... here''s what i have so far: within user.rb file PASSWORD_MIN_LENGTH = 4 PASSWORD_MAX_LENGTH = 40 validates_length_of :password, :within =>
2010 Aug 14
10
Redirecting after logging in
Hey everybody, I''m trying to make an example of a small networking site, and when I log in a user, it should redirect and show his profile, but I get the following error: NoMethodError in User#index Showing app/views/user/index.html.erb where line #5 raised: undefined method `screen_name'' for nil:NilClass Extracted source (around line #5): 2: Your basic information 3:
2007 Dec 06
2
passing parameters through link_to
Is it possible to pass parameters through link_to that will be used by the controller that link_to directs to? Specifically I have this code: <% for user in @users -%> <%= link_to user.screen_name, {:action => "index", :controller => "users", :user_id => user.id } %> <% end %> Is it possible to use the parameter at the end of link_to(:user_id
2011 Jan 24
11
Can't get login to work
Hi, could anybody help me try to get a login function working, I have created a database for users called user1, I have the login screen set up but when i hit login with a correct username and password, nothing happens I am expecting the lgin button to direct the user to the main page and show the user as logged on, but nothing happens! Thanks! Controller class User1Controller <
2009 Apr 06
9
setup method in functional tests and instance variables
I have the following in my functional test file. class UserControllerTest < ActionController::TestCase fixtures :users def setup @controller = UserController.new @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new @invalid_user = user(:invalid_user) @valid_user = users(:valid_user) end def test_login_success
2011 Apr 30
8
"uninitialized constant PostsController::Post"
This time i read scaffold tutorial very carefully and finally try to generate a form without using the scaffold(just used a controller and view ).what i have done till now ,is as follow.Using rails 3.0.7. "rails generate controller posts index" 1) post_controller.rb class PostsController < ApplicationController def index @post=Post.new
2011 Jul 15
3
Ruby variable that embeds html tags
This seems very simple, but I can''t quite get it. Probably because I''m just starting out with RoR. My view has a slew of labels and text fields; many are "required": <%= f.text_field :screen_name %> <span class="required_field">Required field</span> (The "required_field" class turns the text red and smaller.) I''d like to