[Rails] Re: simple_fields_for help

2013-09-02 Thread Brent Brent
dont worry just got my fix this worked = fav.label :state_name if !fav.object.id.nil? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails f

[Rails] simple_fields_for help

2013-09-02 Thread Brent Brent
hello folks Im trying to populate a text_field with a simple_fields_for and it works as expected for the collection of data but at the end i always end up with a empty text_field where i could input data, how do not display the empty text_field. Here is a stub of what im trying to do in haml =

[Rails] Re: where to put logic

2012-09-02 Thread brent brent
Colin Law wrote in post #1074344: > On 2 September 2012 19:23, brent brent wrote: >> external call and is not expensive. so where is the best place to do >> things that happen from external calls and do not directly relate to the >> mvc? any advice would be helpfull thanks.

[Rails] where to put logic

2012-09-02 Thread brent brent
Folks Quick question, i know db model logic goes into the model and how the views are interacted with goes into the controller code. And how the page looks goes into the view code with rails. But lets say i have a system call that shells out and runs a command that populates an array with a list

[Rails] How to set the default value on a simple_form association

2012-05-31 Thread brent brent
Folks Im using simple_form and im able to see a selection of users from my drop down list but im trying to set the default value. Here is what ive tried <%= f.association :people, :input_html => { :value => 'someval' } %> i want someval to be set in the selection by default. Any help would be app

[Rails] Dumb question

2012-05-27 Thread brent brent
Folks Can a model just have a belongs_to only? or do you have to have a belongs_to and a has_many or has_one on the other model? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this

[Rails] Help with find

2012-05-18 Thread brent brent
Folks When im in rails 3.2 console i can do this just fine p = Person.last p.last_name and it prints the last name. But when i try to find it by the id, its able to locate the single record and store it in my variable p, but i cant print the last_name column. For example. p = Pers

[Rails] how to call destroy from jquery

2012-02-15 Thread brent brent
Folks Does anyone know how i could call destroy on a controller using rails 3.1 from a jquery function. Im just trying to find some examples online and cant seem to find anything that shows this. Thanks -- Posted via http://www.ruby-forum.com/. -- You received this message because you are sub

[Rails] Re: rails can i pass arguments to controllers new action

2012-02-11 Thread brent brent
Michael Pavling wrote in post #1045589: > On 11 February 2012 16:31, brent brent wrote: >> Folks >> Was wondering is it possible to pass args into the new action on a >> controller? I have some javascript that is passing in a date to action >> new on a controller and i

[Rails] rails can i pass arguments to controllers new action

2012-02-11 Thread brent brent
Folks Was wondering is it possible to pass args into the new action on a controller? I have some javascript that is passing in a date to action new on a controller and i want to set a field if the date was passed in. -- Posted via http://www.ruby-forum.com/. -- You received this message becau

[Rails] set a default value with simple_form

2012-01-07 Thread brent brent
hello anyone know how i can set a default integer value with simple_form, i have code like this below in my view but its not working. <%= f.input :age, :value => '30' %> i would like the input box to have the value of 30 by default thanks for any help. -- Posted via http://www.ruby-forum.com/.

[Rails] How to pass a field from simple_form as a hidden div value

2012-01-06 Thread brent brent
Hi folks Im trying to pass a value to my hidden div using simple_form but im not sure how to do this, was wondering if anyone could help me with this. Here is my view using simple_form <%= f.label "First name" %> <%= f.text_field :first_name %> <%= f.label "Last name" %> <%= f.text_fie

[Rails] Re: how to access an element from a instance variable

2011-11-26 Thread brent brent
brent brent wrote in post #1033872: > Folks im new to rails and was wondering how i would access these > elements from my view > > > in my controller i have > @data = Editpatient.find(:all, :conditions => ["patient_id = ?", > params[:patients]] ) > > and

[Rails] how to access an element from a instance variable

2011-11-26 Thread brent brent
Folks im new to rails and was wondering how i would access these elements from my view in my controller i have @data = Editpatient.find(:all, :conditions => ["patient_id = ?", params[:patients]] ) and in the view i have <%= @data %> this displays all the data but i only want one field. This is