Re: [Rails] Help Radio button

2013-03-02 Thread Gautam Pai
Maybe you can look at these screencasts and learn how to dynamically add form elements using javascript and then adapt it for your case as needed. http://railscasts.com/episodes/196-nested-model-form-part-1 http://railscasts.com/episodes/197-nested-model-form-part-2 http://railscasts.com/episodes/

Re: [Rails] Help Radio button

2013-03-02 Thread Walter Lee Davis
On Mar 2, 2013, at 11:20 AM, NN Dodhia wrote: > Hi i'm fairly new to ruby on rails and i'm creating a form using simple_form > and in one bit i have radio buttons and say i have 3 buttons a,b,c so i want > it to be if a is pressed then certain text fields show, and if b is pressed a > differen

Re: [Rails] Persistance of good data on validation fail

2013-03-02 Thread Colin Law
On 2 March 2013 17:23, Dave Castellano wrote: > Thank you everyone for the previous validation help. I have one last > question... Can anyone tell me if there is a standard way to deal with a > failed > validation and loss of the data that was partially completed on the > form. I currently use a

Re: [Rails] Help Radio button

2013-03-02 Thread Colin Law
On 2 March 2013 16:20, NN Dodhia wrote: > Hi i'm fairly new to ruby on rails and i'm creating a form using simple_form > and in one bit i have radio buttons and say i have 3 buttons a,b,c so i want > it to be if a is pressed then certain text fields show, and if b is pressed > a different set of t

Re: [Rails] Re: Persistance of good data on validation fail

2013-03-02 Thread Jodi Showers
Dave, consider this refactor create an instance method in your question model def standard? question_type == "standard" end then your view/controller syntax get a bit more readable @question.standard? On Sat, Mar 2, 2013 at 12:56 PM, Dave Castellano wrote: > When I "render :new", the view

[Rails] Re: Persistance of good data on validation fail

2013-03-02 Thread Dave Castellano
Never mind... got it! @question_type == "standard" -- 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 from it, send an email to rubyonrail

[Rails] Re: Persistance of good data on validation fail

2013-03-02 Thread Dave Castellano
When I "render :new", the view gets called correctly but there is a partial in the new.html.erb view which does not render. <%= form_for @question, :as=> :question, :url => { :action => "create"} do |f| %> <% if @question_type == "standard" %> <%= render 'new_and_edit_fields', f: f %>

[Rails] Re: Persistance of good data on validation fail

2013-03-02 Thread Dave Castellano
Jodi S. wrote in post #1099859: > further this url will help with any other questions > > http://guides.rubyonrails.org/layouts_and_rendering.html Thank you. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails:

Re: [Rails] Persistance of good data on validation fail

2013-03-02 Thread Jodi Showers
further this url will help with any other questions http://guides.rubyonrails.org/layouts_and_rendering.html On Sat, Mar 2, 2013 at 12:40 PM, Jodi Showers wrote: > render the view - @question will be given to the view for rendering the > previous values > > render :new if @question.errors.any?

Re: [Rails] Persistance of good data on validation fail

2013-03-02 Thread Jodi Showers
render the view - @question will be given to the view for rendering the previous values render :new if @question.errors.any? On Sat, Mar 2, 2013 at 12:23 PM, Dave Castellano wrote: > Thank you everyone for the previous validation help. I have one last > question... Can anyone tell me if there

[Rails] Help Radio button

2013-03-02 Thread NN Dodhia
Hi i'm fairly new to ruby on rails and i'm creating a form using simple_form and in one bit i have radio buttons and say i have 3 buttons a,b,c so i want it to be if a is pressed then certain text fields show, and if b is pressed a different set of text fields show and similarly for c. Can anyo

[Rails] Persistance of good data on validation fail

2013-03-02 Thread Dave Castellano
Thank you everyone for the previous validation help. I have one last question... Can anyone tell me if there is a standard way to deal with a failed validation and loss of the data that was partially completed on the form. I currently use a redirect back to the same action and lose all the data (o

Re: [Rails] Following railstutorial.org tutorial, how to make the microposts be seen by all?

2013-03-02 Thread Colin Law
On 2 March 2013 10:27, Shawn Francis wrote: > I am a new learner of Ruby on Rails. > I followed through the railstutorial.org tutorial and I'm trying to > learn off the sample demo app where you can to make microposts and only > the people who are "following" you can see them. > If I wanted to mak

[Rails] Re: how to play video in ruby on rails

2013-03-02 Thread Rishi J.
Hi Ralph Shnelvar I followed your steps for using jw_player_helper. I got the jw player on my view but somehow it does not play any video. I have put up the video under public/videos .When click on play, it shows no-access or file not found at videos/3.mp4 . What I could be missing? I am workin

[Rails] Following railstutorial.org tutorial, how to make the microposts be seen by all?

2013-03-02 Thread Shawn Francis
I am a new learner of Ruby on Rails. I followed through the railstutorial.org tutorial and I'm trying to learn off the sample demo app where you can to make microposts and only the people who are "following" you can see them. If I wanted to make it so every user can see microposts as an additional

[Rails] Re: Security Guide needs maintenance

2013-03-02 Thread Frederick Cheung
On Friday, March 1, 2013 10:02:05 PM UTC, Leo Dirac wrote: > The Ruby on Rails Security Guide http://guides.rubyonrails.org/security.html > has a fairly embarrassing anachronism in it.  In section 2.2 on Session ids > it reads  > > > To date MD5 is uncompromised, but there have been collisions,

[Rails] Security Guide needs maintenance

2013-03-02 Thread Leo Dirac
The Ruby on Rails Security Guide http://guides.rubyonrails.org/security.html has a fairly embarrassing anachronism in it. In section 2.2 on Session ids it reads To date MD5 is uncompromised, but there have been collisions, so it is > theoretically possible to create another input text with t