Ruby on Rails Saturday, November 30, 2013

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.

Ruby on Rails

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.

Ruby on Rails

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.

Ruby on Rails


Hi Frederick,

If I change the path to tasks_path, I get the following error while navigating on to the page which has this form. If I keep task_path, navigation works fine. 

    undefined local variable or method `tasks_path' for #<#<Class:0xa3de690>:0xb550f644>
I don't see any error in development.log when I click on the Add button. the page re-loads as expected because of "task_path" url but data doesn't persist. 

Trace:

    Started POST "/task" for 127.0.0.1 at 2013-11-30 15:11:15 +0530
    Processing by HomeLoginController#task as HTML
      Parameters: {"utf8"=>"✓", "authenticity_token"=>"wXpiPiPabBjOBN1iqF/Hj4z81y3RCcSj/gRSpWFuIC0=", "task"=>{"name"=>"eeff"}, "commit"=>"Add"}
      ^[[1m^[[36mUser Load (0.2ms)^[[0m  ^[[1mSELECT "users".* FROM "users" WHERE "users"."id" = 1 LIMIT 1^[[0m
      ^[[1m^[[35mTask Load (0.2ms)^[[0m  SELECT "tasks".* FROM "tasks"
      Rendered home_login/_job_form.html.erb (1.2ms)
      Rendered home_login/task.html.erb within layouts/application (67.2ms)
    Completed 200 OK in 97.6ms (Views: 93.5ms | ActiveRecord: 0.4ms)

Also, I missed adding create action in controller earlier, have added it now:

        def create
Task.create params[:task]
redirect_to :back
end

Thanks. 

--
Regards,
Ankur 



On Sat, Nov 30, 2013 at 3:09 PM, Frederick Cheung <frederick.cheung@gmail.com> wrote:


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.

Ruby on Rails



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.

Ruby on Rails Friday, November 29, 2013

I'm learning on creating a website using Ruby on Rails (RoR). I had an HTML template that I created when I worked with JSP 2 years ago, and now I want to reuse it in my RoR website. This is HTML file

    <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>

and this is the javascript file jquery.Nav.js

    (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);

In the application.html.erb of RoR project, I include the js file like this

      <%= javascript_include_tag "jquery.Nav.js" %>

However, my homepage doesn't work even though I put the <script type="text/javascript">$('#nav').spasticNav();</script> inside the body tag of RoR project

    <body>
      <div class="container">
          <%=  render 'layouts/header'%>
          
              <%=yield%>
          
          <%=  render 'layouts/footer'%>
      </div>
    
    <script type="text/javascript">
        $('#nav').spasticNav();
    </script>
    
    </body>

Is there anyway to embed the $('#nav').spasticNav() into the js file. I tried many ways but it still doesn't work. Thanks a lot.

EDIT:  I saw some examples online that they embed the function into js file like this. 

    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.

Ruby on Rails


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. 

view/task.html.erb
<%= render :partial => "job_form" %>

<% for job in @jobs %> 
<%= job.name %>
<% end %>

view/_job_form.html.erb
<%= form_for(@job, :url => task_path) do |f| %>
<%= f.label :name %>
<%= f.text_field :name %>
<%= f.submit "Add" %>
<% end %>

/view/home_login_controller.rb
def task
@job = Task.new
@jobs = Task.all
end

db/<migration stamp>_create_tasks.rb
def change
    create_table :tasks do |t|
   t.string :name
          t.timestamps
    end
 end

db/schema.rb
 create_table "tasks", :force => true do |t|
    t.datetime "created_at", :null => false
    t.datetime "updated_at", :null => false
    t.string   "name"
  end

app/models/task.rb
class Task < ActiveRecord::Base
  # attr_accessible :title, :body
end

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? 

Thanks. 
--
Regards,
Ankur 

--
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.

Ruby on Rails



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)
  end 

probably 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.

I would change the setup task to

task :setup, :except => { :no_release => true } do
        dirs = [File.join(shared_path,'ckeditor_assets' )]
        run "#{try_sudo} mkdir -p #{dirs.join(' ')} && #{try_sudo} chmod g+w #{dirs.join(' ')}"
      end 

and leave the rest of your deploy.rb the same.

Then as long as you run that setup task at least once, current/public/ckeditor_assets should point to shared/ckeditor_assets

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/527ceb46-e2f7-4981-9db8-24d4da361415%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails



I started project to create a library of  basic functions (or 'helpers' as you wish) .

The start with ds_string.   want to  contribute:  was already made available at rubygem.org

Has two basic functions:

"A".times(3) => "AAA" (like "A" * 3 )
"A".times(3) do |s| "#{s}-" end  => "A-A-A-"
"1".to_b  => true
"yes".to_b => true

=)
Nardele Salomon

--
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.

Ruby on Rails

Now I just changed this to 
task :register_dirs do
    set :uploads_dirs,    %w(/../../shared/ckeditor_assets)
    set :shared_children, fetch(:shared_children) + fetch(:uploads_dirs)
  end

It is creating a ckeditor_assets folder but it is not opening. May be permission issue. 

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)
  end 

probably 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_assets

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/8ca4aa6c-e9db-45a6-8a93-cc9292e760d7%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

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)
  end 

probably 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_assets

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/63d855b5-d5f8-478f-be5c-e426df31e993%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

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.

Ruby on Rails



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_assets

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/ec6f5be4-8b22-4cdf-86c3-1eb4957d6861%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails



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!!   :(


Why are you using such an old (and beta) version of rspec?

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/29a4cf0f-f3b5-46fb-a987-49cef33afbd6%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

Hi all, I have Rails 4.0.0 app, 

After capistrano deploy my ckeditor_assets  are being removed. Could not symlink to shared/ckeditor_assets folder.

I have followed this step :

    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

I could not figure this out why my public/ckeditor_assets folder is not copied to shared/ckeditor_assets and doesnt symlink also.

Please help me.

--
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.

Ruby on Rails


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.

Ruby on Rails Thursday, November 28, 2013

HI , 

am working on ruby on rails , i have to interact with bio metric hardware using ROR, 
how can interact?? is there any gems to interact or we need to use serial port?

Thanks,
Rajeeva 

--
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.

Ruby on Rails

Just joined the facebook group.

Many thanks


On 28 November 2013 21:16, Daniel Kehoe <fortuityconsulting@gmail.com> wrote:


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.

--
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/22f072db-3c15-4752-9f3b-01b06043d03e%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/CAL_gTQH%2BUtSL45tN9ZZwyV7K2CBrOMyZ5ffY-TVm47svJEkf0g%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

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.