similar to: Rails 3 - Nested Forms, using Builder -- Check_box issue

Displaying 20 results from an estimated 600 matches similar to: "Rails 3 - Nested Forms, using Builder -- Check_box issue"

2010 Dec 01
10
How to Redirect from http://mysite.com to https://www.mysite.com on Herok
Hello I''m looking to learn how to redirect all non-www (mysite.com) to https://www.mysite.com I tried the following: class ApplicationController < ActionController::Base before_filter :check_uri def check_uri redirect_to request.protocol + "www." + request.host_with_port + request.request_uri if !/^www/.match(request.host) if Rails.env ==
2010 Dec 22
2
Rails - JSON object with an array?
Hello, I''m able to create and send a JSON object like so: @mylist << { :id => item.id, :name => name.id } render :json => { :result => ''success'', :mylist => @mylist } That works great. Problem I''m having now is that I need to include users which can be 1 or users per item. @mylist << {
2010 Nov 20
2
This installation of RMagick was configured with ImageMagick 6.6.4 but ImageMagick 6.6.5-0 is in use
Hi all, just installed ImageMagick on my Mac, then added the gem rmagick, and not can''t launch the server on my local machine. Anyone experience this or have any ideas? rails s /Library/Ruby/Gems/1.8/gems/rmagick-2.13.1/lib/RMagick2.bundle: This installation of RMagick was configured with ImageMagick 6.6.4 but ImageMagick 6.6.5-0 is in use. (RuntimeError) from
2011 Feb 16
1
test emails did not arrive at SMTP server : after dovecot installation
Just set up postfix & it's running on my RHES 4.2 box. Immediately after postfix is up, I test sending emails from a permitted domain (ahhh, on this postfix server's domain firewall, we even have a firewall rule which permits Tcp25 from those few sending domains' SMTP servers) using an email client to sender_id@[IP_address_of_the_postfix_server] & the /var/log/maillog on
2006 Apr 18
2
check_box
I''ve got a question on the use of check_box. *** This is working but there just has to be a better way: RHTML: <% for book in @books do %> <tr> <td><%=book.label%></td> <td> <%checked = book.subscribed ? ''checked'': ''nope''%> <%=check_box("book" + book.id.to_s,
2006 Jul 19
6
Howto: Check_box with a variable (no model)
Hi, I would like to put a checkbox on a form where the input field is a variable rather than a field in a model. The normal way (with a model) would be: <%= check_box(''client'', ''accept'', {}, "1", "0") %> But since accept is a variable @accept and model client will not be there, how do I make a check box work? Regards, Paul
2006 Oct 15
2
Getting check_box to default to checked?
I''ve tried this (in a new method/template -- so @type doesn''t actually exist yet): check_box ''type'', ''notify_on_create'', {:checked=>''true''} But :checked seems to get swallowed. I''ve also tried setting notify_on_create to true in the Type model, but that doesn''t work either. Any way to get the
2006 Jun 07
5
check_box:how to update 2 checkboxes dependent on each other
I''ve got the following problem, I''ve created two check_boxes in my view. The user has to select one check_box, but isn''t allowed to seth both of them together on true. Now i am looking for functionality that can help me doing the folling: Scenario 1 CheckBox1 = True, The user sets CheckBox2 from False to True, now CheckBox1 should automatically become False.
2006 May 03
2
disabled check_box does not work as expected?
I have a checkbox: <%= check_box(:day, :monday, {:disabled => ''''} , (day.monday == true ? {:checked => ''checked''} : {:checked => false} )) %> It is disabled allright, but it is always uncecked. Is this supposed to happen. It looks like (day.monday == true ? {:checked => ''checked''} : {:checked => false} ) is not
2007 Apr 16
6
How to use a form.check_box ?
Hey guys, I''m trying to have a simple webform in my administration section to add a user. I have the text_fields for adding the user''s name, password, and password confirmation, but cannot seem to figure out the checkbox. I want it to be a single checkbox, that if clicked, will set the database column "access" to be "admin" and if its unchecked, set it to be
2006 May 03
1
Differences betwen check_box_tag and check_box form helper.
What is the difference between the check_box_tag and the check_box form helper? I can''t understand why both must exist. :( Thanks. Fernando Lujan
2010 Dec 12
1
PGError: ERROR: invalid byte sequence for encoding "UTF8": 0xa0
Hello, my app is reading emails with attachments and inserting the Email message into the database to be sent to delayed job for processing. When inserting an email with attachments into the database, I get the following error: PGError: ERROR: invalid byte sequence for encoding "UTF8": 0xa0 Has anyone seen this before? There doesn''t seem to be much rails related via
2006 Aug 10
2
check_box form helper questions/issues
I''m using Rails 1.1.x and it looks like the check_box form helper expects me to provide and object and method so it can determine if the checkbox should be checked or not. I''m having a couple of issues with this. note: I''m using UserEngine and adding a HABTM so that: class User < ActiveRecord::Base has_and_belongs_to_many :foos end class foo <
2007 Dec 15
3
check_box not being checked
I''m new to RoR and I''m having a little problem that I can''t solve. My model is simple. I have Lists and ListItems. I have a view that loops through all the list items, and I put the HTML for the each list item row in a partial called _list_item.rhtml. This is the view, called show.rhtml <ul> <%= render(:partial => "list_item", :collection =>
2010 Dec 21
8
Rails - escape_javascript without all the \n\n\n\n\n
Hello, I''m using escape_javascript to return a partial to the browser via ajax. Something like: $("#inject").html("<%=escape_javascript(render :partial =>"feed/ index")%>"); Problem is escape_javascript ends up outputing all kinds of wasted space like \n\n\n\n\n \n Is there anyway in Rails to escape_javascript more
2007 Dec 13
16
"Tricks" for testing after_create callback???
I''ve got a model Message, which needs to send an email using action mailer after it''s first saved in the database. I want to pass the model to the mailer which then uses methods on the message model to render the email. So the natural way to do this is in an after_create callback on the Message model. But I can''t see an easy way to test this. Here''s my spec
2005 Dec 19
4
need some help designing my messaging system
I am trying to create a messaging system for my users but I''m having a hard time designing my db. This is what i have in mind, but I am not sure if its the best approach. user has_one inbox user has_one outbox inbox has_many messages outbox has_many messages inbox table user_id outbox table user_id messages table box_id (refers to either inbox or outbox - how?) from_id to_id
2006 Jan 21
3
need some help designing my threaded messaging system
Hi, I want to create a messaging system that recognizes threads of messages, not unlike gmail. So far I have these models: Conversation belongs_to :user has_many :messages Message belongs_to :conversation The problem I am running into is not only does a conversation belong to a user but the conversation also has a receipient user with his/her corresponding conversation. How would I
2006 Nov 04
0
Check_box woes
I have a User model and an Address model. A user has_many addresses, and an address belongs_to a user. An address object for a user could be a billing, shipping or marketing address. The way I''m tracking this is via the user attributes: billing_adress_id, marketing_address_id and shipping_address_id in the user table, which holds the relevant address id. But in my form that allows a
2006 Mar 20
3
Linking two HTML SELECT''s together
Hi, How do I link two HTML SELECT''s together. Let''s say for example that I have a drop-down list with a list of all countries. Once the user selects one of the countries I would like to make an AJAX call back to the server to populate the second drop-down list with all of the cities for that country. Any ideas on how to go about to do this? Regards Jerrie Pelser --