Displaying 4 results from an estimated 4 matches for "find_by_screen_name".
2008 Jun 13
1
TypeError (can't modify frozen hash) - Production Mode Only
...would recognize
that, and simply return errors. Now it fails to do so. All my other
validations on the message seem to work fine, its just this one that
fails. The appropriate code:
if
#other validations on the message
else
while (i<hold.length)
if User.find_by_screen_name(hold[i]) == nil
@message.errors.add("Recipient " + hold[i] + " doesn''t
exist!")
@message.destroy
break
else
if trfa == false
@message.recipients = "," +
User.find_by_screen_name(hold[i])....
2008 May 03
2
ActionMailer Multiple recipients
...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
recipient = User.find_by_screen_name(line)
email = recipient.email.to_s + ","
address << email
end
if param_posted?(:message)
@message = Message.new(params[:message])
if @message.valid?
UserMailer.deliver_groupmess(
:user => user,
:recipient => address,...
2008 May 15
0
partial_updates feature in rails 2.1, failing to save because of validate_presence _of on other attributes in the table
...a wide
table without resorting to the validation_scenarios plugin.
Any ideas on how I can fix this?
Black-Mac:turbocis89 Charles$ script/console
Loading development environment (Rails 2.0.991)
>> Spec.partial_updates
=> true
>> User.partial_updates
=> true
>> @user = User.find_by_screen_name(''vince888'')
=> #<User id: 1, screen_name: "vince888", password: "vince888", email:
"vince-wop0JeY5JKhWk0Htik3J/w@public.gmane.org", created_at: "2008-05-15 12:35:12", updated_at:
"2008-05-15 13:03:38", authorization_token: ni...
2008 Jul 07
3
How to get a users screen name into a hidden field in a PostsController action?
Instead of the user entering a name, I want to pass their screen name
along with supplied :title and :content fields. here is what I''ve
got..
f.hidden_field :author, user.screen_name
here is the create method from Posts controller:
def create
@title = "Gravity"
@user = User.find(params[:id]) # this does not work, and I don''t
know why
if request.post?