On 30 November 2013 20:45, Love U Ruby <lists@ruby-forum.com> wrote:
> Hi,
>
> I am very new to rails.. I am having hard times to understand the
> ActiveRecord associations.. I tried
> http://guides.rubyonrails.org/association_basics.html .. But it is not
> for beginners. :)
>
> Is there any good tutorials, to understand the concept?
Work right through a good tutorial such as railstutorial.org, which is
free to use online.
Colin
--
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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLtbbL2MyzLdEgBsNHb5hAuaJs9frk3Dh3OQT-VGNMPhtQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.
Hi,
I am very new to rails.. I am having hard times to understand the
ActiveRecord associations.. I tried
http://guides.rubyonrails.org/association_basics.html .. But it is not
for beginners. :)
Is there any good tutorials, to understand the concept?
Thanks
--
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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/20b46d89b3a86484e7c095b062e5f18e%40ruby-forum.com.
For more options, visit https://groups.google.com/groups/opt_out.
On 29 November 2013 22:18, Ankur Kumar <specialankur@gmail.com> wrote:
>
> Hi,
>
> I created a simple form using form_for and partials. When I enter a value in
> text field and click on add button, the data doesn't get uploaded in
> database table.
Can I suggest that you work right through a good tutorial such as
railstutorial.org (which is free to use online). That will show you
the basics of rails so that you will be able to answer simple
questions yourself.
Colin
--
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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLu_UQSRoeVopJA%3DF8m%2B%3DJDc8O2RRbGY93DS9G43AucqEw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.
undefined local variable or method `tasks_path' for #<#<Class:0xa3de690>:0xb550f644>
--
On Friday, November 29, 2013 10:18:26 PM UTC, Ankur wrote:I have done db migration and db schema exists for table but "select * from tasks" doesn't return any rows and therefore UI doesn't show any form data. Can someone please help me debug this issue?So what does happen when you click on the form's button ? Did you look at your application logs / server output? At first glance you're posting to the wrong url - to create a new task you post to tasks_path where you have forced the url to task_path (which would be appropriate for updating an existing task).Fred
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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/46cf8fba-f24b-4eec-896c-b87e5ee4bca8%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CALSL1eNC5VxTzMzRH8B7yM98LaMWekRaSJmK36g_5uq0e4-NzQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.
On Friday, November 29, 2013 10:18:26 PM UTC, Ankur wrote:
I have done db migration and db schema exists for table but "select * from tasks" doesn't return any rows and therefore UI doesn't show any form data. Can someone please help me debug this issue?
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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/46cf8fba-f24b-4eec-896c-b87e5ee4bca8%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
<body>
<div id="container">
<ul id="nav">
<li><a href="index.html">Livingroom</a></li>
<li><a href="about.html">Bedroom</a></li>
<li><a href="#">Mattress</a></li>
<li id="selected"><a href="#">Bathroom</a></li>
<li><a href="#">Kitchen</a></li>
<li><a href="#">Office</a></li>
<li><a href="#">Outdoor</a></li>
<li><a href="#">About Us</a></li>
<li><a href="#">My Account</a></li>
<li><a href="#">SearchBar</a></li>
</ul>
</div>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js"></script>
<script type="text/javascript" src="js/jquery.Nav.js"></script>
<script type="text/javascript">
$('#nav').spasticNav();
</script>
</body>
</html>
(function($) {
$.fn.spasticNav = function(options) {
options = $.extend({
overlap : 20,
speed : 500,
reset : 1500,
color : '#0b2b61',
easing : 'easeOutExpo'
}, options);
return this.each(function() {
var nav = $(this),
currentPageItem = $('#selected', nav),
blob,
reset;
$('<li id="blob"></li>').css({
width : currentPageItem.outerWidth(),
height : currentPageItem.outerHeight() + options.overlap,
left : currentPageItem.position().left,
top : currentPageItem.position().top - options.overlap / 2,
backgroundColor : options.color
}).appendTo(this);
blob = $('#blob', nav);
$('li:not(#blob)', nav).hover(function() {
// mouse over
clearTimeout(reset);
blob.animate(
{
left : $(this).position().left,
width : $(this).width()
},
{
duration : options.speed,
easing : options.easing,
queue : false
}
);
}, function() {
// mouse out
reset = setTimeout(function() {
blob.animate({
width : currentPageItem.outerWidth(),
left : currentPageItem.position().left
}, options.speed)
}, options.reset);
});
}); // end each
};
})(jQuery);
<%= javascript_include_tag "jquery.Nav.js" %>
<body>
<div class="container">
<%= render 'layouts/header'%>
<%=yield%>
<%= render 'layouts/footer'%>
</div>
<script type="text/javascript">
$('#nav').spasticNav();
</script>
</body>
jQuery(document).ready(function($){
/*---------------------------------
MENU Dropdowns
-----------------------------------*/
$('ul.menu').each(function(){
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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/5a1acb49-5d1d-4c6c-9e6b-c1fdcc834ca7%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CALSL1eOOmhPeuvcKcfKe%2BwaUiV66oXw9fJ-VcUC_ityJEKG%3DQQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.
On Friday, November 29, 2013 10:47:29 AM UTC, debadatta wrote:
Thank you very much Frederick Cheung for reply.task :register_dirs do
set :uploads_dirs, %w(public/ckeditor_assets)
set :shared_children, fetch(:shared_children) + fetch(:uploads_dirs)
endprobably you are saying about this to create a directory for shared/ckeditor_assets where as this is creating a folder shared/public/ckeditor_assets. I have cheked the folders there are no folders such like that after deplyment.Also for deleting public/ckeditor_assets.. yes i think it gets deleted and after the deployment I can not able to fetch this directory also.Shall I need to change anything except this in my deploy.rb.
dirs = [File.join(shared_path,'ckeditor_assets' )]
run "#{try_sudo} mkdir -p #{dirs.join(' ')} && #{try_sudo} chmod g+w #{dirs.join(' ')}"
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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/527ceb46-e2f7-4981-9db8-24d4da361415%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/bbcfa543-9824-43ba-8c47-42cf3fffd791%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
task :register_dirs do
set :uploads_dirs, %w(/../../shared/ckeditor_assets)
set :shared_children, fetch(:shared_children) + fetch(:uploads_dirs)
end
On Friday, 29 November 2013 16:17:29 UTC+5:30, debadatta wrote:
Thank you very much Frederick Cheung for reply.task :register_dirs do
set :uploads_dirs, %w(public/ckeditor_assets)
set :shared_children, fetch(:shared_children) + fetch(:uploads_dirs)
endprobably you are saying about this to create a directory for shared/ckeditor_assets where as this is creating a folder shared/public/ckeditor_assets. I have cheked the folders there are no folders such like that after deplyment.Also for deleting public/ckeditor_assets.. yes i think it gets deleted and after the deployment I can not able to fetch this directory also.Shall I need to change anything except this in my deploy.rb.Any help appreciated.Thanks
On Friday, 29 November 2013 16:06:52 UTC+5:30, Frederick Cheung wrote:
On Friday, November 29, 2013 10:02:33 AM UTC, debadatta wrote:I could not figure this out why my public/ckeditor_assets folder is not copied to shared/ckeditor_assets and doesnt symlink also.Just so you we are clear, you do realise that these cap tasks *delete* public/ckeditor_assets ? They then symlink to shared/ckeditor_assets, but obviously that needs to be created by you.The setup task does look like it is half trying to do that but you don't seem to be invoking it, furthermore it would seem to be creating shared/public/ckeditor_assets rather than shared/ckeditor_assetsFred
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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/8ca4aa6c-e9db-45a6-8a93-cc9292e760d7%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
task :register_dirs do
set :uploads_dirs, %w(public/ckeditor_assets)
set :shared_children, fetch(:shared_children) + fetch(:uploads_dirs)
end
On Friday, 29 November 2013 16:06:52 UTC+5:30, Frederick Cheung wrote:
On Friday, November 29, 2013 10:02:33 AM UTC, debadatta wrote:I could not figure this out why my public/ckeditor_assets folder is not copied to shared/ckeditor_assets and doesnt symlink also.Just so you we are clear, you do realise that these cap tasks *delete* public/ckeditor_assets ? They then symlink to shared/ckeditor_assets, but obviously that needs to be created by you.The setup task does look like it is half trying to do that but you don't seem to be invoking it, furthermore it would seem to be creating shared/public/ckeditor_assets rather than shared/ckeditor_assetsFred
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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/63d855b5-d5f8-478f-be5c-e426df31e993%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
On 28 November 2013 12:32, Vidyuth Kini <vukini@gmail.com> wrote:
> ...
> 6. I get the following error when running rake db:create
>
> Couldn't create database for {"adapter"=>"postgresql",
> "username"=>"postgres", "database"=>"UIS", "host"=>"localhost"}
Post your database.yml here.
Colin
--
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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLtRHwE%3D_aWP6w0NPtxpi86R7d7iGRtUTyWHPwbWso3tHQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.
On Friday, November 29, 2013 10:02:33 AM UTC, debadatta wrote:
I could not figure this out why my public/ckeditor_assets folder is not copied to shared/ckeditor_assets and doesnt symlink also.
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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/ec6f5be4-8b22-4cdf-86c3-1eb4957d6861%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
On Friday, November 29, 2013 9:14:01 AM UTC, Mezbah Alam wrote:
i want to make Mostly Static Pages according to video tutorial youtube "16 Ruby On Rails ROR Lesson3 Mostly Static Pages Mostly Static Pages" but i'm stuck with "rails generate rspec:install"
i need your help!! :(
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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/29a4cf0f-f3b5-46fb-a987-49cef33afbd6%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
namespace :uploads do
desc <<-EOD
Creates the upload folders unless they exist
and sets the proper upload permissions.
EOD
task :setup, :except => { :no_release => true } do
dirs = uploads_dirs.map { |d| File.join(shared_path, d) }
run "#{try_sudo} mkdir -p #{dirs.join(' ')} && #{try_sudo} chmod g+w #{dirs.join(' ')}"
end
desc <<-EOD
[internal] Creates the symlink to uploads shared folder
for the most recently deployed version.
EOD
task :symlink, :except => { :no_release => true } do
run "rm -rf #{release_path}/public/ckeditor_assets"
run "ln -nfs #{shared_path}/ckeditor_assets #{release_path}/public/ckeditor_assets"
end
desc <<-EOD
[internal] Computes uploads directory paths
and registers them in Capistrano environment.
EOD
task :register_dirs do
set :uploads_dirs, %w(public/ckeditor_assets)
set :shared_children, fetch(:shared_children) + fetch(:uploads_dirs)
end
after "deploy:finalize_update", "uploads:symlink"
on :start, "uploads:register_dirs"
end
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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/98351c53-2abb-4d47-bda9-1f65cadb503a%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
i want to make Mostly Static Pages according to video tutorial youtube "16 Ruby On Rails ROR Lesson3 Mostly Static Pages Mostly Static Pages" but i'm stuck with "rails generate rspec:install"
i need your help!! :(
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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/8280445e-e1df-4e57-adf3-f03d755ecfd4%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/8c5068d8-6707-44b9-b588-b0b77aa36e30%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
On Thursday, November 28, 2013 1:05:52 PM UTC-8, trekr67 wrote:Anyone else who is a newbie Rails developer and would like to join me studying Daniel Kehoe's book?You might find study companions on a Facebook group:Also be sure to look for Ruby or Rails meetups locally if you are in major metro area.--To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/22f072db-3c15-4752-9f3b-01b06043d03e%40googlegroups.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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL_gTQH%2BUtSL45tN9ZZwyV7K2CBrOMyZ5ffY-TVm47svJEkf0g%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.
In my project i want to make tasks like in taskrabbit.com, that user could create task and another user could respond on it. And the user who created task could choose candidates and change status to "accomplished" my models:
class Post < ActiveRecord::Base belongs_to :user belongs_to :category has_many :responces end class Responce < ActiveRecord::Base belongs_to :user belongs_to :post default_scope -> { order('created_at DESC') } end
my posts controller
class PostsController < ApplicationController load_and_authorize_resource def new @category = Category.find(params[:category_id]) @post = @category.posts.new(category_id:params[:category_id]) end def index @category = Category.find(params[:category_id]) @posts = Post.all end def create @post = current_user.posts.build(post_params) @category = Category.find(params[:category_id]) if @post.save flash[:success] = "Поздравляем Ваше задание опубликованно" redirect_to post_path @post else render 'new' end end def update @post = current_user.posts.build(post_params) @category = Category.find(params[:category_id]) end def show @post = Post.find(params[:id]) #@category = Category.find(params[:category_id]) @feed_items = @post.responces.paginate(page: params[:page]) end def feed Responce.where("post_id = ?", id) end def destroy @post.responces.destroy redirect_to post_path @post end private def post_params params.require(:post).permit(:destroy, :name, :content, :date, :time, :category_id, :price, :adress1, :adress2) end end
my view
<%= link_to 'Choose candidate', feed_item, method: :update, data: { confirm: 'Are you sure?' } %> </li>
and my responce controller
class ResponcesController < ApplicationController def new @post = Post.find(params[:post_id]) @responce = @post.responces.new(post_id:params[:post_id]) @responce.user = current_user end def create @post = Post.find(params[:post_id]) @responce = @post.responces.build(responce_params) @responce.user = current_user if @responce.save flash[:success] = "Вы откликнулись на задание" redirect_to post_path @post else render 'new' end end def show end def destroy @responce = Responce.find(params[:id]) @responce.destroy redirect_to posts_path @post end private def responce_params params.require(:responce).permit(:price, :comment, :post_id) end end
Can you help me out with that, how I can make it done. Is there any gem or articles about it?
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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/26d6cafc-b4ab-4ebb-8ff5-1a2207b16a2c%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.