Hey all I had a question about this, I'm using 3.2 and was wondering how would I implement live preview using the example above?? i have it working where when I enter the new information it reads the markdown
Ryan, with the advent of Rails4 do you still recommend this as the the best method for implementing a json api? Do you believe certain intended consumption mediums would respond to different techniques? iPhone client full RESTful actions vs simple read consumtion? Thanks in advance!
When creating a new product in this example, released at Date comes with four fields. How do I format to get only one input field for date. I do not need the time
Please assist
Pierre
Ok, I have it almost working (without redis), but my question is that whenever I get a dropdown from this, if I put my mouse over the results or I press down arrow, the results go away. How can I get it to be able to select one of the results and fill in the rest of the search box?
Everything works great but I have one bug and can not understand why it doesnt work. My search script (which works on submit) works only on 2nd submission. First submit reloads the page and second submit sends AJAX request. After that if submit again -> reload, submit again -> ajax. (one after another)
Why it happens?
My application JS:
$(function () {
// Search form.
Is there a way to not show a feed like "Ryan deleted a question" (Can't show the question title anyway because the record was destroyed) ? I tried doing this by checking if activity.trackable is false but it didn't work.
Rookie in need of some help: It doesn't seem to matter what I do, I get this error:
.rvm/gems/ruby-1.9.3-p286-falcon/gems/actionpack-4.0.0/lib/action_dispatch/routing/mapper.rb:229:in `default_controller_and_action': missing :controller (ArgumentError)
Bundler complete without problems, rake or rails commands fails with before mentioned or simular.
I checked controllers, and yes; they are all there...
So far I have narrowed it down to my routes.rb, but can't see what the problem is.
Any help?
Great screencast. Glad to see it has been revised.
However, this solution only works for simple types of forms/associations. It becomes far more complicated (and confusing) to try and create a form like this that allows you to create different types of associations, each with their own set of fields (i.e. TextareaQuestion, MultipleChoiceQuestion, each subclassing a generic Question class). Almost like a polymorphic form builder.
I'm working on trying to create this type of form. It doesn't feel like this type of thing is supported very well by Rails form helpers. I'm having the same difficulty using the simple_form gem.
Essentially, you need to create a drill-down that allows you to select the type of association you want to create, then display the form fields relevant to the type you have selected.
It would be nice to see an example of this. I bet Ryan Bates would have a nice, clean way to accomplish this. =]
Yes, Paypal sandbox site has changed. But it is pretty much the same functionality. In case some configured this with the old sandbox and is trying to use it now, getting the error
hope you're enjoying you're well deserved time off. Just thought I should add that the way to ensure you have the most recent version of mongoid would be to write
This is particularly important as the gem available from rubygems.org seems to have some problems with Rails 4 whereas the github version works perfectly with it.
any one have solution to find area near to the zip_code i try near method but it will give me all the area which has the same zip_code it can not find near zip_code area so any one have solution then reply me... thanx
i use ex:-> @something = SomeThing.near(params[:search])
in params[:search] i found zip_code of the city like (10001)
ya i also face same kind of problem i also try to search area near to zip code but it will result same zip code data
are you having same kind of problem
I saw that too. My first instinct was to look up whether or not this is some new HTML5 thing, but then I decided that Ryan might actually be human and it is just a mistake.
I'm trying to follow the instructions of the video. I executed the commands as required:
rails new store
rails g scaffold product name price:decimal --skip-stylesheets
rake db:migrate
rails g bootstrap:install
rails g bootstrap:themed products -f
of course I also put the twitter-bootstrap-rails gem into the gemfile
but when I run localhost:3000/products I get this (from the terminal where I run the server)
Started GET "/products" for 127.0.0.1 at 2013-06-29 16:06:39 +0800
Processing by ProductsController#index as HTML
Product Load (0.1ms) SELECT "products".* FROM "products"
Rendered products/index.html.erb within layouts/application (18.3ms)
WARN: tilt autoloading 'less' in a non thread-safe way; explicit require 'less' suggested.
Completed 500 Internal Server Error in 69ms
ActionView::Template::Error (cannot load such file -- less
(in /Users/ansonzeall/Desktop/lab/Rails/bootstrapTest/store/app/assets/stylesheets/bootstrap_and_overrides.css.less)):
2:
3:
4: Store
5: <%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>
6: <%= javascript_include_tag "application", "data-turbolinks-track" => true %>
7: <%= csrf_meta_tags %>
8:
app/views/layouts/application.html.erb:5:in `_app_views_layouts_application_html_erb__2649677383696800529_70257843367120'
By checking the docs Action Mailer - Receiving Emails you'll see that no receivers are provided, i.e. nor POP3 or Maildir built-in support.
You need to somehow trigger the ActionMailer recieve method every time an email is received, e.g.
rails runner 'UserMailer.receive(STDIN.read)'
Mailman solves that for you but ActionMailer doesn't, you would need to write your own Maildir Guard plugin and/or a POP3 polling daemon to call UserMailer.receive
Great episode. When a person creates a new account, there is no remember me functionality and his session is not automatically stored after creating a new account.
In episode #270, you showed us how to accomplish this by adding the following code (and adding : session[:user_id] = @user.id)
users_controller.rb
defcreate@user = User.new(params[:user])
if@user.save
session[:user_id] = @user.id
redirect_to root_url, notice:"Thank you for signing up!"else
render "new"end
How would we accomplish this being that we are not using the session and we are now using the cookie?
Obviously don't forget about fragment caching. This will save a lot of time on rendering and database hits.
You can write JOIN clauses that filter the activities which do not have the
trackable
association. This is more of a database question, than Ruby.You can still display attributes this way:
params
hash to cache attributes you want to display even when tracked object is removedremoved
to true (more refactoring required)I do like Form Objects, but all examples of it forget the edit action, which increases the complexity of the Form Object and decreases its beauty.
Don't forget to wrap up the
save!
in a transaction.If something went wrong in the
profile.save!
theuser
must be rolledback.I do like Form Objects, but all examples of it forget the edit action, which increases the complexity of the Form Object and decreases its beauty.
Can't verify CSRF token authenticity
Hey all I had a question about this, I'm using 3.2 and was wondering how would I implement live preview using the example above?? i have it working where when I enter the new information it reads the markdown
then i enter
in the bottom of the view.... its listening and showing the words but no markdown syntax is applied... how would I do this?
Aha. I had the same problem but I realized that the ASCIIcast doesn't have it while the main code does!
+1 thanks for that!
This is awesome. The helper class is just fantastic - very flexible and easily extendible.
Thanks Ryan.
+1
Any solution?
Ryan, with the advent of Rails4 do you still recommend this as the the best method for implementing a json api? Do you believe certain intended consumption mediums would respond to different techniques? iPhone client full RESTful actions vs simple read consumtion? Thanks in advance!
When creating a new product in this example, released at Date comes with four fields. How do I format to get only one input field for date. I do not need the time
Please assist
Pierre
Ok, I have it almost working (without redis), but my question is that whenever I get a dropdown from this, if I put my mouse over the results or I press down arrow, the results go away. How can I get it to be able to select one of the results and fill in the rest of the search box?
Removed 'patch :update_many' from routes.rb - now things are looking up :)
Everything works great but I have one bug and can not understand why it doesnt work. My search script (which works on submit) works only on 2nd submission. First submit reloads the page and second submit sends AJAX request. After that if submit again -> reload, submit again -> ajax. (one after another)
Why it happens?
My application JS:
$(function () {
// Search form.
$('#identities_search').submit(function () {
$.get(this.action, $(this).serialize(), null, 'script');
return false;
});
$('#sortbut a, #sortbutq a, #identities .pagination a, #pagination a').live('click',
function () {
$.getScript(this.href);
return false;
}
);
});
Is there a way to not show a feed like "Ryan deleted a question" (Can't show the question title anyway because the record was destroyed) ? I tried doing this by checking if activity.trackable is false but it didn't work.
+1
I'm using these steps with Rails 4 and I received this error:
undefined local variable or method `accessible_attributes' for #Class:0x007fbbd2134da0
I think this is wrong, it has changed but it gives error using your syntax.
Rookie in need of some help: It doesn't seem to matter what I do, I get this error:
.rvm/gems/ruby-1.9.3-p286-falcon/gems/actionpack-4.0.0/lib/action_dispatch/routing/mapper.rb:229:in `default_controller_and_action': missing :controller (ArgumentError)
Bundler complete without problems, rake or rails commands fails with before mentioned or simular.
I checked controllers, and yes; they are all there...
So far I have narrowed it down to my routes.rb, but can't see what the problem is.
Any help?
Does someone has an example with localized facebook login page?
The following doesn't work with omniauth-facebook gem
it should produce this link
but produces instead
Because of that the facebook login page isn't localized
Thanks for this tip!
Great screencast. Glad to see it has been revised.
However, this solution only works for simple types of forms/associations. It becomes far more complicated (and confusing) to try and create a form like this that allows you to create different types of associations, each with their own set of fields (i.e. TextareaQuestion, MultipleChoiceQuestion, each subclassing a generic Question class). Almost like a polymorphic form builder.
I'm working on trying to create this type of form. It doesn't feel like this type of thing is supported very well by Rails form helpers. I'm having the same difficulty using the simple_form gem.
Essentially, you need to create a drill-down that allows you to select the type of association you want to create, then display the form fields relevant to the type you have selected.
It would be nice to see an example of this. I bet Ryan Bates would have a nice, clean way to accomplish this. =]
Sadik, doesn't seem so. But I've blogged about setting up OpenID here http://thirstyforcola.wordpress.com/2013/06/30/setting-up-openid-on-rails/
Yes, Paypal sandbox site has changed. But it is pretty much the same functionality. In case some configured this with the old sandbox and is trying to use it now, getting the error
I solved this temporarily by changing
with
in the paypal_url method.
I was having this problem and this is the answer I found.
http://stackoverflow.com/questions/11762401/rubber-2-fog-and-keypair-error
@Antoine You might want to try the following...
as this is what worked for me.
I'm running a VPS on Ubuntu 12.04, the deployment works fine but i need to restart of the server to update the code !
Why ?
Hi Ryan,
hope you're enjoying you're well deserved time off. Just thought I should add that the way to ensure you have the most recent version of mongoid would be to write
This is particularly important as the gem available from rubygems.org seems to have some problems with Rails 4 whereas the github version works perfectly with it.
Regards,
Chris
Hi, How I can do to make sign_in root is the main route from my app?
Rack responses are not required to define
join
, onlyeach
. To ensure all responses are handled correctly by the middleware you can change it to:response_body = '' body.each{|bod| response_body << bod } response_body
Here's alternative chef solo wrapper as a gem:
https://github.com/scottvrosenthal/iron_chef
any one have solution to find area near to the zip_code i try near method but it will give me all the area which has the same zip_code it can not find near zip_code area so any one have solution then reply me... thanx
i use ex:-> @something = SomeThing.near(params[:search])
in params[:search] i found zip_code of the city like (10001)
if any one have solution of this please reply me
ya i also face same kind of problem i also try to search area near to zip code but it will result same zip code data
are you having same kind of problem
I have a readonly api hosted on heroku. I also built an android client for this api.
What I want is that only my android app should be able to consume this api.
What is the best possible solution I can apply. Do I need ssl certificate?
Thanks in advance!!
I would like to know (links) how to keep user logged in info inside cookies safety.
Thanks man, your note just saved me a lot of time!
To disable MiniProfiler temporarily, just append ?pp=disable to the URL.
I saw that too. My first instinct was to look up whether or not this is some new HTML5 thing, but then I decided that Ryan might actually be human and it is just a mistake.
hi,,what are the changes required for this tutoial,me using rails 4.0.0 version
Could you put this on GitHub?
Where can I find the example of the fnordmetric.rb file? The link is not to the file.
one more for episode to be revised
Hi
I'm trying to follow the instructions of the video. I executed the commands as required:
rails new store
rails g scaffold product name price:decimal --skip-stylesheets
rake db:migrate
rails g bootstrap:install
rails g bootstrap:themed products -f
of course I also put the twitter-bootstrap-rails gem into the gemfile
but when I run localhost:3000/products I get this (from the terminal where I run the server)
Started GET "/products" for 127.0.0.1 at 2013-06-29 16:06:39 +0800
Processing by ProductsController#index as HTML
Product Load (0.1ms) SELECT "products".* FROM "products"
Rendered products/index.html.erb within layouts/application (18.3ms)
WARN: tilt autoloading 'less' in a non thread-safe way; explicit require 'less' suggested.
Completed 500 Internal Server Error in 69ms
ActionView::Template::Error (cannot load such file -- less
(in /Users/ansonzeall/Desktop/lab/Rails/bootstrapTest/store/app/assets/stylesheets/bootstrap_and_overrides.css.less)):
2:
3:
4: Store
5: <%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>
6: <%= javascript_include_tag "application", "data-turbolinks-track" => true %>
7: <%= csrf_meta_tags %>
8:
app/views/layouts/application.html.erb:5:in `_app_views_layouts_application_html_erb__2649677383696800529_70257843367120'
says cannot load the less file
Thanks for the tip :). Easy solution to what I thought might get uglier.
Seems line image attachments is a bit undercooked in active admin. Any examples of a good way to to it, including deleting & preview.
Currently im using paperclip & editing the form like this:
f.input :image,
:as => :file,
:hint => f.template.image_tag(f.object.image.url(:medium))
I could keep going and add some JS and a delete button, but it seems like something the framework should administer
Thanks a lot. I had the same problem.
+100
By checking the docs Action Mailer - Receiving Emails you'll see that no receivers are provided, i.e. nor POP3 or Maildir built-in support.
You need to somehow trigger the ActionMailer recieve method every time an email is received, e.g.
Mailman solves that for you but ActionMailer doesn't, you would need to write your own Maildir Guard plugin and/or a POP3 polling daemon to call UserMailer.receive
I figured it out :). I knew it was something easy.
needed to replace:
session[:user_id] = @user.id
with:
cookies[:auth_token] = @user.auth_token
Ryan,
Great episode. When a person creates a new account, there is no remember me functionality and his session is not automatically stored after creating a new account.
In episode #270, you showed us how to accomplish this by adding the following code (and adding :
session[:user_id] = @user.id)
How would we accomplish this being that we are not using the session and we are now using the cookie?
Louis