Many Thanks!
I was expecting this episode since last week :)
Nice one Ryan! I recommend you all to checkout the Formtastic I18n features, they are very flexible. Not only useful for internationalization, but also usability. Peep the README. =)
Very nice one, Ryan. Was waiting a week for this one :) Keep up the good work
One small typo in the models/symptom.rb file: the symptom belongs to an :animal, not an ":animial" :-)
Thanks a lot Ryan for all of your screencasts.
Really good episode!! I love Monday mornings with a new Railscasts episode ;)
Hi ryan. Once again grt screencast. I love it and going to use it on me next small rails project.
Great episode. In episode 63, you discussed permalinks. If you're using some name as opposed to the id number for seo, is it possible to use formtastic and how would you do that?
Hello Ryan!
I could not find a better way to start my weeks than watching your railscasts!
Congratulations!
Luciano
Awesome as usual but do you think you could put a better spam filter on your site?
There are tons of spam posts in your comments.
Keep up the great work!
@Frederic, thanks for mentioning the typo, fixed now.
@Todd, Formtastic is not tied to the URL, so you are free to use a permalink instead of an id in there and it won't conflict.
@cbmeeks, planning to solve the spam problem soon, thanks!
And I was just looking for Formtastic tutorials when I stumbled upon this. Great as usual, Ryan!
Formtastic is great, but if you don't want your forms so tightly linked to your models, check out the Informant plugin/gem:
http://github.com/alexreisner/informant
Love it! I was just wondering about many to many relationships. I just have one question: what about when the list is too large to put in a list box or check boxes?
For example, I have a large database of names and phone numbers, and people can share phone numbers and also have many different phone numbers. Some sort of autocomplete and ajax addition would be interesting.
One thing I'd love to see is what if your symptoms model had been a full fledged model with additional attributes that couldn't be placed on either of the joined models? Say it had a "cured_on" attribute for when that particular problem was cured. How would you handle that?
How to build a form without a model linked to it? It can be done with this gem?
Oh, and one other thought, what about adding a new symptom/problem that doesn't exist yet? I think you did a railscast on adding a has_many like that, but how about a many-to-many?
Thanks Ryan. As usually your great tutorial helped me shave off those precious hours!
@DGM Formtastic there's a plugin for Formtastic that does auto complete, but IMHO, focusing on what Formtastic can't do is the wrong attitude, because you would've had to write all that code anyway. In the meantime, it's done _everything else_ for you :)
It's very easy to mix-and-match Formtastic code with custom ERB code or even make your own custom inputs (which I do all the time) to solve specific problems.
@Timóteo Formtastic is built on top of Rails' built in FormBuilder, so yes, it's very much tied to forms that have models. However, it's important to point out that it will work with *any* model or class that behaves a little bit like an ActiveRecord object.
A good example of this is AuthLogic, which has a UserSession model that isn't an ActiveRecord model, but there are plenty of people that have built login forms that work with the UserSession model and Formtastic.
@Jamie the CSS file included is, more than anything, a proof-of-concept. If you want labels on top, go for it, it's a few lines.
Eventually I'd like to offer both, because different situations will call for either a side-by-side layout or a labels-on-top layout. I'd be sceptical of any study that makes a claim that either approach is "always more usable".
I think someone's working on a formtastic-sass plugin too which does both styles.
Hi! Formtastic is very cool !
And good screencast (as usual!) :)
@justin:
Is there any helper like remote_form_for in Formtastic ?
Best regards,
Bruno
For anyone who uses haml/sass, you can get multiple form layouts (labels on top, left or right) for free using a simple sass sheet.
http://github.com/activestylus/formtastic-sass
Thanks for this! I was interested about formtastic since I first heard about it on RailsEnvy podcast a few weeks ago.
Any chance there's a third part planned to cover more has_many :through topics? Personally creating new records, auto complete and additional relationship fields have always trouble me.
But again, thanks for the awesome intro to formtastic!
There is a way to use formtastic to handle multiple models in one form like the Ryan's Classic Recipe?
Great one, as usual!
However, what if you have to deal with complex multi column forms?
Seems I'm getting spoiled ...
I am getting
The requested URL /videos/185_formtastic_part_2.mov was not found on this server.
Looking forward to watching:)
The link doesnt seem to be working...
i get a 404 message when i try to download the video
There seems to be a problem with the podcast when subscribing from itunes.
non of the files seem to be on the server:
for example it says this file can't be found on the server, and for that matter none of them can.
http://media.railscasts.com/videos/185_formtastic_part_2.m4v
Update: the latest gem would copy the formtastic.rb file to config/initializers and you don't have to create one by hand.
Nice that you added CAPTCHA to prefend spam. But now i can not help you with spam reports because of authorized error message.
Thanks for your create screencasts!
Cu
When using model associations (@user.posts), @post.categories, etc), you can order the options by using the :collection parameter:
<% semantic_form_for(@user) do |f| %>
<% f.inputs do %>
# Posts is an association to users
<% f.posts, :collection => Post.all(:order => :name) %>
<% end %>
<% end %>
Is there any explanation as to why we need to use 'attr_accessible' on all attributes in the model? Seems like a lot of work...
Any ideas how i get the code from the complex forms railscasts to work with formtastic ?
How would that project example look in formtastic ?
<% for task in @project.tasks %>
<% fields_for "project[task_attributes][]", task do |task_form| %>
<p>
Task: <%= task_form.text_field :name %>
</p>
<% end %>
<% end %>
great stuff! so, what about dynamic select boxes?? still by hand?
Hi, nice screencast!
Do you happen to know if the formtastic handles acts_as_tree plugin in association has_many :through? For example: I want to have check_boxes in the form like as tree structure..(Like categories and subcategories in eshop).
Thank you,
H.
Trying to recreate this with HAML but can't get it to work can you give me the basic form?
great tutorial from the great plugin, very nice, thanks for 2 great episode about formtastic. but i got a problem when i use paperclip, attr_accessible can't be used, because paperclip use attr_protected. whould you like to tell me about this situation ?, or give me a link about attr_protected to read ?. sorry my english is bad...
Thank you very, very much for this. I was stuck on forms for 5 hours today trying to do a multi-select on a has many through. When I couldn't figure it out I said "f it. Railscasts will have a better solution". 30 minutes later, everything works perfectly. Thank you very much!
Robert
Thanks for this one, Ryan!
A third part would be nice, like in complex forms 3, where you add/remove checkboxes dynamically ;-)
@carl
See the formtastic rdoc, there's an example for nested forms ;-)
Great Screencast i love ruby. Formtastic I18n is fantastic! Thank you very much!
Thanks for this Ryan and all the other great casts you have done.
Have you managed to get this excellent gem to work with Rails3, I cant seem to get rid of the undefined method semantic_form_for error
This is really a very nice post. And yes I liked the comments too.
Nice script.I have another similar script also.Let me try this..... :)
I am finding something like this.And now it is end in your post thnx.
Thank you very much for the information. It's new for me and it is a very knowledgeable post. Thanks for sharing with us.
And how do you do unit tests? If you have a partial which is one of these semantic_form_for, how the blazes do you run renderizer so that it works, hm?
No unit testing examples, no TDD. Pity.
This is one of the best posts that I’ve ever seen; you may include some more ideas in the same theme. I’m still waiting for some interesting thoughts from your side in your next post.
Just to share with you, as I have spent plenty of hours figuring that. It is useful to have datepicker in date field. I have found a nice gist by @voldy. On http://blog.brzezinka.eu/webmaster-tips/ruby/ruby-on-rails-formtastic-jquery-ui-datepicker I show how to integrate jQuery UI datepicker with Ruby on Rails Formtastic gem.
Very nice one, Ryan. Was waiting a week for this one :) Keep up the good work
Nice post! Although we are familiar with our culure, but we maybe don't really understand it. It need to study deeply.
Great job here guys. Keep the great posts coming. I follow your blog and I follow you on Twitter.
Not only useful for internationalization, but also usability. Peep the README. =)
Nice post! Thanks Ryan. A very interesting read. Good job. Although we are familiar with our culure, but we maybe don't really understand it.
Took me awhile to read all the comments, but I really love the article. It proved to be very useful to me and I am sure to all the commenters here! It's always nice when you can not only be informed, but also entertained! I'm sure you had fun writing this article. Comfortably, the article is really the sweetest on this precious topic.
Some times, to a certain need, we have to convert PDF to image for enjoyment.
Discount Wholesale Electronics, Wholesale Cell Phones, Electronic Gadgets and More from the Best Dropship Wholesaler
Thanks for sharing your article. I really enjoyed it. I put a link to my site to here so other people can read it. My readers have about the same interets
The beauty of these blogging engines and CMS platforms is the lack of limitations and ease of manipulation that allows developers to implement rich content and 'skin' the site in such a way that with very little effort one would never notice what it is making the site tick all without limiting content and effectiveness.
This is a smart blog. I mean it. You have so much knowledge about this issue, and so much passion. You also know how to make people rally behind it, obviously from the responses. Youve got a design here thats not too flashy, but makes a statement as big as what youre saying. Great job, indeed.
Once again grt screencast. I love it and going to use it on me next small rails project.
Good post, I can’t say that I agree with everything that was said, but very good information overall:)






